DB2 Scalar functions - LTRIM
The LTRIM function removes any of the specified characters from the beginning of a string.
The character search compares the binary representation of each character (consisting of one or more bytes) in the trim expression to the binary representation of each character (consisting of one or more bytes) at the beginning of the string expression. The database collation does not affect the search. If the string expression is defined as FOR BIT DATA or is a binary string, the search compares each byte in the trim expression to the byte at the beginning of the string expression.
The schema is SYSIBM. (The SYSFUN version of this function is also available. That version uses a single parameter, removes leading blanks only, and accepts CLOB arguments.)
An expression that specifies the string to be trimmed.
An expression that specifies the characters that are to be removed from the beginning of a string expression. The expression must return a built-in character string, numeric value, Boolean value, or datetime value.
The data type of the string expression determines the default trim expression:
The values for the string expression and trim expression must have compatible data types. If one function argument is character FOR BIT DATA, then the other argument cannot be a graphic (SQLSTATE 42846). A combination of character string and graphic string arguments can be used only in a Unicode database (SQLSTATE 42815).
The data type of the result depends on the data type of the string expression:
The length attribute of the result data type is the same as the length attribute of the data type of the string expression.
The actual length of the result is the length of string-expression minus the number of string units removed. If all of the characters are removed, the result is an empty string with a length of zero.
If any argument can be null, the result can be null; if any argument is null, the result is the null value.
VALUES LTRIM(:HELLO)
VALUES LTRIM('...$V..$AR', '$.')
VALUES LTRIM('[[ -78]]', '- []')