Example: Querying with the SETBIT Function
The following query takes the input argument 23, which has a data type of BYTEINT and a binary representation of 00010111, and sets the value of the third bit to 1. The query result is a BYTEINT value of 23 or binary 00010111.
SELECT SETBIT(23,2);
Example: Querying Input Argument 23 with the ROTATERIGHT Function
The following query takes the input argument 23, which has a data type of BYTEINT and a binary representation of 00010111, and sets the value of the third bit to 0. The query result is a BYTEINT value of 19 or binary 00010011.
SELECT SETBIT(23,2,0);