LENGTH

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

The LENGTH function returns the length of a value. See CHARACTER_LENGTH, OCTET_LENGTH, and BIT_LENGTH for similar functions.

expression
The argument must be an expression that returns a value of any built-in data type.

The result of the function is a large integer. 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 length of the argument. The length of strings includes blanks. The length of a varying-length string is the actual length, not the length attribute.

The length of a graphic string is the number of double-byte characters (the number of bytes divided by 2). The length of all other values is the number of bytes used to represent the value:

Examples