Query Language Components
The text of a query uses a structure similar to the structure of a SELECT statement in SQL, and it has parallels with the structure of a TIBCO BusinessEvents rule, too. The query text is provided as an argument to the Query.create() function.
The syntax diagrams shows the structure of a query and of each clause in a query. Read them from left to right. Items above or below the main line are optional. Items that can repeat are shown by lines that loop back from the end to the beginning of the repeating section, along with the separator character.
- Select Clause
In the select clause, you specify columns that will appear in the query results. - Delete Clause
The delete clause is used only in a delete query. Delete queries are used in a specific situation only. - From Clause
Just as a rule declaration specifies the scope of the rule, the from clause specifies the scope of the query. The items in the from clause must exist in the project ontology. - Where Clause
The optional where clause is analogous to a rule’s conditions. The expression in the where clause can be simple or complex. - Group by Clause
The optional group by clause allows you to group entities that share one or more criteria into a single row. Each group is represented by one row. - Order by Clause
The optional order by clause enables you to sort the results in ascending or descending order. - Limit Clause
You can use an optional limit clause in a select or an order by clause. - Stream Clause
The stream clause is used for continuous queries only. It is used within a from clause. - Stream Policy
The stream policy (also known as a window policy) is used for continuous queries only. It determines what kind of window is used: a time window, sliding window, or tumbling window.
Copyright © Cloud Software Group, Inc. All rights reserved.