Set the value of a specific bit in a bit array.
SET_BIT([ bit-expression, ]bit-position [, value ])
bit-expression The bit array in which to change the bit.
bit-position The position of the bit to be set. This must be an unsigned integer.
value The value to which the bit is to be set.
LONG VARBIT
The default value of bit-expression is a bit array of length bit-position, containing all bits set to 0 (FALSE).
The default value of value is 1 (TRUE).
The result is NULL if any parameter is NULL.
The positions in the array are counted from the left side, starting at 1.
SQL/2008 Vendor extension.
The following statement returns the value 00100011:
SELECT SET_BIT( '00110011', 4 , 0);
The following statement returns the value 00111011:
SELECT SET_BIT( '00110011', 5 , 1);
SELECT SET_BIT( '00110011', 5 );
The following statement returns the value 00001:
SELECT SET_BIT( 5 );