SQL/MP Programming Manual for C
Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for C—429847-008
11-7
CPRL_COMPARE_
string1length
is the number of bytes in string1 to be compared.
string2
is an array containing the second string to be compared. string2 is assumed to
be in original (not encoded) form.
string2length
is the length of string2.
result
indicates the result of the comparison:
For error codes other than 0 (zero), result is meaningless.
cprladdr
is a pointer to the SQL collation or collation object.
CPRL_COMPARE_
The CPRL_COMPARE_ procedure compares two strings according to an SQL
collation or collation object. Both strings are assumed to be in original (not encoded)
form. For strings of unequal length, CPRL_COMPARE_ pads the shorter string with
blanks.
CPRL_COMPARE_ is more efficient for isolated compares, because only the
necessary part of each string is encoded to do the compare. If the same data is
repeatedly compared, use the CPRL_ENCODE_ and CPRL_COMPARE1ENCODED_
procedures (or CPRL_ENCODE_ with binary compares.)
-1 The first operand is less than the second
0 The operands collate equally
1 The first operand is greater than the second
#include <cextdecs(CPRL_COMPARE_)>
short CPRL_COMPARE_ (
char *string1 /* i */
,short string1length /* i */
,char *string2 /* i */
,short string2length /* i */
,short *result /* o */
,long cprladdr ); /* i */