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

Term: TRANSLATE

Definition:
The Oracle TRANSLATE function replaces one set of characters in a string with another set of characters. It performs the replacements in sequence, one character at a time, matching the character to be replaced with the replacement character.

TRANSLATE also allows for multiple targets for the replacement action to be performed on. This means that it will replace the 1st character in the target_string with the 1st character in the replacement_string. Then it will replace the 2nd character in the target_string with the 2nd character in the replacement_string, continuing until all the replacements have been made.

This example removes dashes in a phone number, replacing them with dots:

SELECT TRANSLATE('(425)555-1212', ')-(', '..') phone_number FROM DUAL;


Result:
425-555-1212

Related Links:

Related Code Snippets:
  • TRANSLATE - Converts a character string into the character set specified for conversions between t...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 102 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?