DB2 Scalar functions - STRIP
The STRIP function removes blanks or another specified character from the end, the beginning, or both ends of a string expression.
The schema is SYSIBM. The function name cannot be specified as a qualified name when keywords are used in the function signature.
The STRIP function is identical to the TRIM scalar function.
If strip-character is not specified and:
The value for string-expression and the value for strip-character must have compatible data types.
The data type of the result depends on the data type of the string-expression:
The result is a varying-length string with the same maximum length as the length attribute of the string-expression. The actual length of the result is the length of the string-expression minus the number of string units that are removed. If all of the characters are removed, the result is an empty varying-length string. The code page of the result is the same as the code page of the string-expression.
Assume that the host variable BALANCE of type CHAR(9) has a value of '000345.50'.
SELECT STRIP(:BALANCE, LEADING, '0'), FROM SYSIBM.SYSDUMMY1