Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 The Action Statements : ORDERED Clause

ORDERED Clause
An ORDERED clause can be used in conjunction with a WHERE clause to retrieve occurrences in a specific order using the operators ASCENDING or DESCENDING.
Default Order for Tables
By default a table is ordered in ascending order by primary key, although this can be changed in the table definition.
Usage Notes
If seven or more ORDERED clauses are used in a table access statement, the external sort program setup for your TIBCO Object Service Broker installation is used to sort the values. In this case, the total number of bytes occupied by all control fields must not exceed 4088 bytes.
Examples
1.
2.
FORALL CARS WHERE CITY = INVOICE.CITY ORDERED DESCENDING
   PRICE & ORDERED ASCENDING MODEL :
About the Examples
Example 1 orders the occurrences of the MIDWEST instance of the EMPLOYEES table in descending order of LNAME field, and then retrieves the first occurrence whose DEPTNO equals the value of the DEPT field of the INPUT table.
Example 2 retrieves the occurrences in descending values of the field PRICE, then by ascending values of the field MODEL, and then by ascending values of the primary key (the default for ordering is ascending).
See Also
TIBCO Object Service Broker Managing Data about TIBCO Object Service Broker tables.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved