Oracle Number Function - Oracle/PLSQL BITAND Function






BITAND(x,y) performs a bitwise AND on x and y.

This Oracle tutorial explains how to use the Oracle/PLSQL BITAND function.

Syntax

The syntax for the Oracle/PLSQL BITAND function is:

bitand( expr1, expr2 )

expr1 AND expr2 to resolve to non-negative integers.

Example


-- from  w ww.  ja v  a2  s  .c o  m
SQL> select BITAND(0, 0) from dual;

BITAND(0,0)
-----------
          0

SQL> select BITAND(0, 1) from dual;

BITAND(0,1)
-----------
          0

SQL> select BITAND(1, 0) from dual;

BITAND(1,0)
-----------
          0

SQL> select BITAND(1, 1) from dual;

BITAND(1,1)
-----------
          1

SQL> select BITAND(1010, 1100) from dual;

BITAND(1010,1100)
-----------------
               64

SQL>