trim enables you to trim leading or trailing characters
(or both) from a character string. If character or source is a character
literal, then you must enclose it in single quotes.
- If you specify LEADING, then Oracle removes any leading
characters equal to character.
- If you specify TRAILING, then Oracle removes any trailing
characters equal to character.
- If you specify BOTH or none of the three, then Oracle removes
leading and trailing characters equal to character.
- If you do not specify trim_character, then the default value
is a blank space.
- If you specify only source, then Oracle removes leading and
trailing blank spaces.
- The function returns a value with datatype VARCHAR2. The
maximum length of the value is the length of source.
- If either source or character is null, then the TRIM function
returns null.
Both character and source can be any of the datatypes CHAR,
VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is of
VARCHAR2 datatype and is in the same character set as source.