BIT_CHECK

Purpose

This function checks whether a certain bit of a numerical value is set. The position parameter starts from 0, which means the lowest bit.

Syntax

bit_check::=

Bit Check

Usage Notes

  • Bit functions are limited to 64 bits, which is positive numbers between 0 and 18446744073709551615.
  • The value pos may be between 0 and 63.

Examples

SELECT BIT_CHECK(3,0) B0,
       BIT_CHECK(3,1) B1,   
       BIT_CHECK(3,2) B2,
       BIT_CHECK(3,3) B3;
Result
B0 B1 B2 B3
TRUE TRUE FALSE FALSE