Product SiteDocumentation Site

7.4.8. BITOR (Bit by Bit OR)


>>-BITOR(string1--+--------------------------+--)--------------><
                  +-,--+---------+--+------+-+
                       +-string2-+  +-,pad-+

Returns a string composed of the two input strings logically inclusive-ORed, bit by bit. (The encodings of the strings are used in the logical operation.) The length of the result is the length of the longer of the two strings. If no pad character is provided, the OR operation stops when the shorter of the two strings is exhausted, and the unprocessed portion of the longer string is appended to the partial result. If pad is provided, it extends the shorter of the two strings on the right before carrying out the logical operation. The default for string2 is the zero-length (null) string.
Here are some examples:

Example 7.13. Builtin function BITOR

BITOR("12"x)                  ->    "12"x
BITOR("15"x,"24"x)            ->    "35"x
BITOR("15"x,"2456"x)          ->    "3556"x
BITOR("15"x,"2456"x,"F0"x)    ->    "35F6"x
BITOR("1111"x, ,"4D"x)        ->    "5D5D"x
BITOR("pQrS", ,"20"x)         ->    "pqrs" /* ASCII   */