@VALONEOF
Use the @VALONEOF
function to compare a string or string (character) column to a list of values. If the value or column is in the list, 1
is returned; otherwise 0
is returned. This function trims trailing spaces before the comparison.
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. The target column must be a SQL Unicode data type if any argument is supplied as Unicode.
This function does not support NCHAR
or NVARCHAR
data types.
Syntax
@VALONEOF (expression, value [, value] [, ...])
Example
In the following example, if STATE
is CA
or NY
, the expression returns COAST
, which is the response returned by @IF
when the value is non-zero (true
). Otherwise, the expression returns MIDDLE
.
@IF (@VALONEOF (STATE, 'CA', 'NY'), 'COAST', 'MIDDLE')