The bit_or() function

The bit_or() function performs a bitwise logical OR on two binary data type columns.

Syntax

bit_or(column1, column2)
column1, column2
Two input binary data type columns.

Usage

If the columns are of different length, the return value is the same length as the longer input parameter, with the OR operation performed up to the length of the shorter parameter. The remainder of the return value is the unprocessed data in the longer string.

Return codes

The function returns the value of the bitwise logical OR operation.

If either parameter is NULL, the return value is also NULL.

Example

In the following example, the value binaryvarcol1 is '00006000':
SELECT bit_or(binaryvar_col1, '00080000'::binaryvar) FROM table WHERE x = 1
expression
------------------
00086000