SQL/MP Programming Manual for C

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for C429847-008
11-9
CPRL_DECODE_
The CPRL_COMPAREOBJECTS_ procedure returns these values:
cprladdr1
is the address of the first SQL collation or collation object.
cprladdr2
is the address of the second SQL collation or collation object.
CPRL_DECODE_
The CPRL_DECODE_ procedure decodes a string that has been encoded by the
CPRL_ENCODE_ procedure. If the same (or equivalent) SQL collation is used for both
CPRL_ENCODE_ and CPRL_DECODE_, the decoded string equals the original string
with respect to that SQL collation.
Because encoding is not generally a one-to-one function, the decoded string might not
be identical to the original string. For example, an SQL collation that is case-insensitive
might produce a decoded string with different case letters than the original string. The
string ABCDE might encode to a value, which when decoded, is aBcDe.
The CPRL_DECODE_ procedure returns these values:
Code Description
0 The operation was successful; the SQL collations or collation objects are equal.
–2 The SQL collation or collation object is invalid.
–4 The version of the SQL collation or collation object is not supported.
–21 The collations in the two specified SQL collations or collation objects do not match.
#include <cextdecs(CPRL_DECODE_)>
short CPRL_DECODE_ (
char *encodedstring /* i */
,short encodedstringlength /* i */
,char *decodedstring /* o */
,short decodedstringmaxlength /* i */
,short *decodedstringlength /* 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.