|Oracle9i SQL Reference
Release 2 (9.2)
Part Number A96540-01
Functions, 153 of 177
TRIM enables you to trim leading or trailing characters (or both) from a character string. If
trim_source is a character literal, then you must enclose it in single quotes.
LEADING, then Oracle removes any leading characters equal to
TRAILING, then Oracle removes any trailing characters equal to
BOTHor none of the three, then Oracle removes leading and trailing characters equal to
trim_character, then the default value is a blank space.
trim_source, then Oracle removes leading and trailing blank spaces.
VARCHAR2. The maximum length of the value is the length of
trim_characteris null, then the
TRIMfunction returns null.
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: