BIT_OR routine - Returns result of OR operation on input values

The BIT_OR routine runs a bitwise logical OR operation against the values in input1 with input2 and returns the result.

Syntax

Read syntax diagramSkip visual syntax diagramUTL_RAW.BIT_OR( input1,input2)

Parameters

input1
An input argument of type VARBINARY(256) that specifies the FIRST value to the OR operation.
input2
An input argument of type VARBINARY(256) that specifies the SECOND value to the OR operation.

Authorization

EXECUTE privilege on the UTL_RAW module.

Examples

Example 1: The following example shows how to set up a table with a VARBINARY data type:
db2 "create table sample(input1 VARBINARY(20) not null, input2 VARBINARY(20) not null)"                
DB20000I  The SQL command completed successfully.
Example 2: The following example shows how to insert data into a table that has a VARBINARY data type:
db2 "insert into sample(input1, input2) values (bx'3131',bx'32323232')"                                   
DB20000I  The SQL command completed successfully.

db2 "insert into sample(input1, input2) values (bx'3333',bx'34343434')"
DB20000I  The SQL command completed successfully.
Example 3: The following example shows how to run a BIT_OR operation:
db2 "select sysibmadm.utl_raw.bit_or(input1,input2) from sample"

1          
-----------
          x'33333232'
          x'37373434'

  2 record(s) selected.