Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
设置位数组中特定位的值。
SET_BIT( [ bit-expression, ]bit-position [, value ] )
bit-expression 在其中更改位的位数组。
bit-position 要设置的位的位置。它必须是无符号整数。
value 要将位设置成的值。
LONG VARBIT
bit-expression 的缺省值是长度为 bit-position 的位数组,其中包含所有设置为 0 (FALSE) 的位。
value 的缺省值是 1 (TRUE)。
如果任何参数为 NULL,则结果为 NULL。
数组中的位置从左侧开始计数(从 1 开始)。
SQL/2008 服务商扩充。
以下语句返回值 00100011:
SELECT SET_BIT( '00110011', 4 , 0);
以下语句返回值 00111011:
SELECT SET_BIT( '00110011', 5 , 1);
SELECT SET_BIT( '00110011', 5 );
以下语句返回值 00001:
SELECT SET_BIT( 5 );