@STRCMP
Use the @STRCMP
function to compare two character columns or literal strings. Enclose literals within single quote marks.
@STRCMP
returns the following:
-
–1
if the first string is less than the second. -
0
if the strings are equal. -
1
if the first string is greater than the second.
Trailing spaces are truncated before comparing the strings.
For this function, Oracle GoldenGate supports the use of an escape sequence to represent characters in a string column in Unicode or in the native character encoding of the Microsoft Windows, UNIX, and Linux operating systems.
This function does not support NCHAR
or NVARCHAR
data types.
Syntax
@STRCMP (string1
, string2)
Example
The following example compares two literal strings and returns 1
because the first string is greater than the second one.
@STRCMP ('JOHNSON', 'JONES')