The BIT_LENGTH function returns the length of a string expression in bits. See LENGTH , CHARACTER_LENGTH , and OCTET_LENGTH for similar functions.
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.
SELECT BIT_LENGTH( C1 ) FROM T1Returns the value 160.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.