Advantage Concepts
Advantage Expression Engine function that creates a descending index key value
DESCEND(<exp>) à ValueInverted
<exp> |
Any valid expression of any data type other than memo, binary, or image. Valid Advantage expressions can consist of field names, literal values, supported operators, and supported functions. For information on operators and functions supported in Advantage expressions, see Advantage Expression Engine. |
DESCEND() returns an inverted expression of the same data type as the <exp>, except for dates that return a numeric value. A DESCEND() of CHR(0) always returns CHR(0).
DESCEND() is a conversion function that returns the inverted form of the specified expression to be used when creating multi-segmented indexes where one or more segments should be in descending order. Specify the segment of the index expression you want to be descending as the DESCEND() argument.
To subsequently perform a lookup with a seek operation, you must first evaluate it using the Advantage Client Engine AdsInitRawKey and AdsBuildRawKey APIs.
Only use this function to create a certain segment(s) of a multi-segmented index in descending order. If the entire index expression is to be in descending order, create the index with the "descending" option rather than use the DESCEND() function. If you create an index using the "descending" option, you will not need to perform any special operations before performing a seek. "Descending" is an attribute of the index file where it is stored and used for reindexing purposes.
Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.
Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.
AdsCreateIndex
AdsSeek
AdsCreateIndex
AdsInitRawKey
AdsBuildRawKey
AdsSeek