BIT_LENGTH

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram>>---BIT_LENGTH----(--expression--)----------------------------><
 

The BIT_LENGTH function returns the length of a string expression in bits. See LENGTH , CHARACTER_LENGTH , and OCTET_LENGTH for similar functions.

expression
The argument must be an expression that returns a value of any built-in numeric or string data type. A numeric argument is cast to a character string before evaluating the function. For more information on converting numeric to a character string, see VARCHAR.

The result of the function is DECIMAL(31). If the argument can be null, the result can be null; if the argument is null, the result is the null value.

The result is the number of bits (bytes * 8) in the argument. The length of a string includes trailing blanks. The length of a varying-length string is the actual length in bits (bytes * 8), not the maximum length.

Example