Bitwise functions

The following is a list of bitwise functions supported by xfODBC. Note that “exp” represents an expression that results in a numeric value. xfODBC converts non-integer numeric values into integers before performing a bitwise operation.

For links to more information on xfODBC’s support for SQL, see Appendix B: SQL Support.

BITAND

BITAND(num_exp1, num_exp2)

This function returns the result of a bitwise AND operation performed on two numeric values.

For example, the following query returns 1 (0001 AND 1111 = 0001).

SELECT BITAND(1, 15) FROM dual

BITOR

BITOR(num_exp1, num_exp2)

This function returns the result of a bitwise OR operation performed on two numeric values.

For example, the following query returns 15 (0010 OR 1101 = 1111).

SELECT BITOR(2, 13) FROM dual

BITXOR

BITXOR(num_exp1, num_exp2)

This function returns the result of a bitwise exclusive OR operation performed on two numeric values.

For example, the following query returns 14 (0001 XOR 1111 = 1110).

SELECT BITXOR(1, 15) FROM dual