Oracle/PLSQL: Translate Function

In Oracle/PLSQL, the translate function replaces a sequence of characters in a string with another set of characters.
However, it replaces a single character at a time.

For example, it will replace the 1st character in the string_to_replace with the 1st character in the replacement_string.
Then it will replace the 2nd character in the string_to_replace with the 2nd character in the replacement_string, and so on.


The syntax for the translate function is:

translate( string1, string_to_replace, replacement_string )
string1 is the string to replace a sequence of characters with another set of characters.
string_to_replace is the string that will be searched for in string1.
replacement_string - All characters in the string_to_replace will be replaced with the corresponding character in the replacement_string.

Applies To:
Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g

For example:
translate('1tech23', '123', '456); would return '4tech56'
translate('222tech, '2ec', '3it'); would return '333tith'


 Oracle Errors
Oracle Errors and their explanations
Oracle Invalid Objects
Oracle Softwares & Tools

 Frequently asked oracle errors
  • ORA-19502:write error on file "string", blockno string (blocksize=string)
  • ORA-28001:the password has expired
  • ORA-24033:no recipients for message
  • ORA-21561:OID generation failed
  • ORA-01144:File size (string blocks) exceeds maximum of string blocks
  • ORA-12712:new character set must be a superset of old character set
  • ORA-01086:savepoint 'string' never established
  • ORA-00824:cannot set sga_target due to existing internal settings, see alert log for more information
  • ORA-12152:TNS:unable to send break message
  • ORA-19804:cannot reclaim string bytes disk space from string limit
  • ORA-01610:recovery using the BACKUP CONTROLFILE option must be done
  • ORA-12853:insufficient memory for PX buffers: current stringK, max needed stringK
  • ORA-02069:global_names parameter must be set to TRUE for this operation
  • ORA-00027:cannot kill current session
  • ORA-16224:Database Guard is enabled
  • ORA-21780:Maximum number of object durations exceeded.
  • ORA-01732:data manipulation operation not legal on this view
  • ORA-00600:internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
  • ORA-01149:cannot shutdown - file string has online backup set
  • ORA-01190:control file or data file string is from before the last RESETLOGS
  • Main Page      Contact Us