SQL/MP Programming Manual for C

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for C429847-008
11-17
CPRL_GETNEXTINSEQUENCE_
CPRL_GETNEXTINSEQUENCE_
The CPRL_GETNEXTINSEQUENCE_ procedure finds the next string after a specified
string according to an SQL collation or collation object.
This procedure replaces the practice of adding 1 to the least significant character of a
string to find the next greater string, which does not work correctly for nonbinary
collating sequences.
The CPRL_GETNEXTINSEQUENCE_ procedure returns these values:
inputstring
is an array containing the input string.
inputstringlength
is the number of bytes in the input string inputstring.
nextstring
is an array in which CPRL_GETNEXTINSEQUENCE_ returns the next string.
Overlapping inputstring and nextstring causes unpredictable results.
nextstringmaxlength
specifies the maximum length of nextstring. The returned value is padded with
blanks as necessary to fill nextstring for this length. In most cases, set
nextstring to the same value as inputstring.
#include <cextdecs(CPRL_GETNEXTINSEQUENCE_)>
short CPRL_GETNEXTINSEQUENCE_ (
char *inputstring /* i */
,short inputstringlength /* i */
,char *nextstring /* o */
,short nextstringmaxlength /* i */
,short *nextstringlength /* o */
,long cprladdr ); /* i */
Code Description
0 The operation was successful.
–2 The SQL collation or collation object is invalid.
–4 The version of the SQL collation or collation object is not supported.
–20 The user-specified buffer is not large enough to receive the returned string.
–23 The inputstring parameter is already the maximum string of length
inputstringlength.
–24 The input string is longer than the maximum length (256).