Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle TRIM Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: TRIM

Definition:
The Oracle TRIM function removes leading and trailing spaces from a string or column. Space characters are the default, but you can also specify the character(s) to be removed. Characters can be specified as literals ('A', 'm', etc) or by their CHR equivalents: 'CHR(112)', 'CHR(68)'.

The TRIM function returns a value with datatype VARCHAR2.

Example (Default) Syntax:

TRIM();


Example Syntax for specifying a literal character:

SELECT TRIM('Z' FROM 'Zebra') FROM dual;


Example Syntax for specifying a character by its CHR() value:

SELECT TRIM(CHR(90) FROM 'Zebra') FROM dual;


Also See:
Definition & Examples: LTRIM LTRIM (Left Trim) Function
Definition & Examples: RTRIM (Right Trim) Function

Related Links:

Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 131 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?