Bitwise functions v17
The bitwise functions include BITAND
and BITOR
.
BITAND
The BITAND
function performs a bitwise AND
operation and returns a value based on the data type of input argument. The signature is:
The input data type of expr1
and expr2
is a NUMBER
on which the bitwise AND
operation is performed. The BITAND
compares each bit of expr1
value to the corresponding bit of exp2
using a bitwise AND
operation. It returns the value based on the data type of the input argument. If either argument to BITAND
is NULL
, the result is a NULL
value.
Return types
The BITAND
function returns the same value as the data type of the input argument.
Examples
This example performs an AND
operation on the numbers 10 and 11.
BITOR
The BITOR
function performs a bitwise OR
operation and returns a value based on the data type of the input argument. The signature is:
The BITOR
compares each bit of expr1
value to the corresponding bit of exp2
using a bitwise OR
operation. It returns the value based on the data type of the input argument.
Return types
The BITOR
function returns the same value as the data type of the input argument. If all the values of a column are NULL
, the BITOR
returns NULL
.
Examples
This example performs an OR
operation on the numbers 10 and 11.
BITWISE OPERATORS
The bitwise operators perform the same operation as BITAND
and BITOR
. The bitwise operators are:
&
:(Bitwise AND)
Return the result of a bitwiseAND
operation performed on the input type.|
:(Bitwise OR)
Return the result of a bitwiseOR
operation performed on the input type.
Examples
This example uses the &
operator and returns the output as BITAND
of the input:
This example uses the |
operator and returns the output as BITOR
of the input:
- On this page
- BITAND
- BITOR
- BITWISE OPERATORS