XOR

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram                       .---------------.
                       V               |
>>-XOR--(--expression----,--expression-+--)--------------------><
 

The XOR function returns a string that is the logical XOR of the argument strings. This function takes the first argument string, does an XOR operation with the next string, and then continues to do XOR operations for each successive argument using the previous result. If an argument is encountered that is shorter than the previous result, it is padded with blanks.

The arguments must be compatible.

expression
The arguments must be expressions that return a value of any built-in numeric or string data type, but cannot be LOBs. The arguments cannot be mixed data character strings, UTF-8 character strings, or graphic strings. A numeric argument is cast to a character string before evaluating the function. For more information on converting numeric to a character string, see VARCHAR.

The arguments are converted, if necessary, to the attributes of the result. The attributes of the result are determined as follows:

If an argument can be null, the result can be null; if an argument is null, the result is the null value.

The CCSID of the result is 65535.

Example