Oracle Plsql Bitand Function

Oracle / PLSQL: BITAND Function

This Oracle tutorial explains how to use the Oracle/PLSQL BITAND function with syntax and examples.

Description

The Oracle/PLSQL BITAND function returns an integer representing an AND operation on the bits of expr1 and expr2.

Syntax

The syntax for the BITAND function in Oracle/PLSQL is:

bitand( expr1, expr2 )

Parameters or Arguments

expr1 and expr2

Values that must resolve to non-negative integers.

Returns

The BITAND function returns an integer value.

Applies To

The BITAND function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let's look at some Oracle BITAND function examples and explore how to use the BITAND function in Oracle/PLSQL.

For example:

BITAND(5,3)
Output: 1

BITAND(15,7)
Output: 7

BITAND(5,2)
Output: 0

BITAND(5,0)
Output: 0

BITAND(6,2)
Output: 2