DB2 Scalar functions - TRIM
The TRIM 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.
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.
SELECT TRIM(:HELLO) , TRIM(TRAILING FROM :HELLO) FROM SYSIBM.SYSDUMMY1
SELECT TRIM(L '0' FROM :BALANCE), FROM SYSIBM.SYSDUMMY1