solidDB Help : solidDB reference : solidDB SA: Function reference : SaCursorOrderbyVector
  
SaCursorOrderbyVector
SaCursorOrderbyVector is used to specify the order of columns used in a search.
The initial values are used as a vector of values to specify the starting position for the search in the key. The initial value is used only for the starting point selection in the key; after that, the initial values are not checked against the column values. If several criteria are given, they are solved in the given order. A proper key must exist for the ordering.
The initial value is taken from the user variable bound to the column.
Synopsis
SaRetT SA_EXPORT_H SaCursorOrderbyVector(
  SaCursorT* scur,
  char* colname)
Parameters
The following table describes the parameters:
 
Parameters
Usage type
Description
scur
in, use
Pointer to a cursor object
colname
in, use
Column name
Return value
SA_RC_SUCC or error code.
SaCursorOrderbyVector example
/* These variables will be bound to the columns named "I" and "J" */
int i, j;
/* Bind variables to columns in this cursor. */
SaCursorColStr(scur, "I", 'i);
SaCursorColStr(scur, "J", 'j);
/* Set the values that we want to use in the search. */
i = 2;
j = 1;
/* Specify the order of the columns. */
SaCursorOrderByVector(scur, "I");
SaCursorOrderByVector(scur, "J");
/* Search the cursor for matching values. */
SaCursorSearch(scur);
The preceding would be the equivalent of the following SQL WHERE clause:
...WHERE (i,j) >= (2,1)
Go up to
solidDB SA: Function reference