Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Command Center for Db2 13.2

LENGTH function


The LENGTH function returns the length of the argument's value as a large integer.

LENGTH.png

The result is the length of the argument. The length does not include the null indicator byte of column arguments that allow null values. The length of strings includes blanks. The length of a varying-length string is the actual length, not the maximum length.

The length of a graphic string including UTF-16 is the number of double-byte characters.

The length of all other values is the number of bytes used to represent the value:


Data type

Length

SMALLINT

2

INTEGER

4

BIGINT

8

DECIMAL with precision p

The integer part of (p /2) +1

DECFLOAT (34)

16

DECFLOAT (16)

8

Single precision floating point

4

Double precision floating point

8

Strings

The length of the string

DATE

4

TIME

3

TIMESTAMP

10

TIMESTAMP WITH TIMEZONE

12

TIMESTAMP (p)

7+ (( p +1)/2)

TIMESTAMP(p) WITH TIMEZONE

9+(( p +1)/2)

Important

If the argument can be null, the result can be null; if the argument value is null, the result is the null value.






 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*