|Oracle9i SQL Reference
Release 1 (9.0.1)
Part Number A90125-01
Functions, 150 of 166
TRIM enables you to trim leading or trailing characters (or both) from a character string. If
trim_source is a character literal, you must enclose it in single quotes.
LEADING, Oracle removes any leading characters equal to
TRAILING, Oracle removes any trailing characters equal to
BOTHor none of the three, Oracle removes leading and trailing characters equal to
trim_character, the default value is a blank space.
trim_source, Oracle removes leading and trailing blank spaces.
VARCHAR2. The maximum length of the value is the length of
trim_characteris a null value, then the
TRIMfunction returns a null value.
trim_source can be any of the datatypes
NCLOB. The string returned is of
VARCHAR2 datatype and is in the same character set as
This example trims leading and trailing zeroes from a number: