The long existing BITAND function is now within the documentation, to let you do logical AND on two numbers, and is also available from PL/SQL
If you need other bit operations, a little boolean math should suffice
Just make sure you stay within the limits of BINARY_INTEGER
CREATE OR replace FUNCTION bitor( x IN binary_integer, y IN binary_integer ) RETURN binary_integer AS
BEGIN
RETURN x - bitand(x,y) + y;
END;
/
CREATE OR replace FUNCTION bitxor( x IN binary_integer, y IN binary_integer ) RETURN binary_integer AS
BEGIN
RETURN bitor(x,y) - bitand(x,y);
END;
/




Got some thoughts? Leave a comment