Translate function Oracle
Translate function Oracle
Posted on September 30, 2012 by sqlandplsql
TRANSLATE function replaces a string with another set of characters.TRANSLATE replace characters in sequential order.
Syntax
TRANSLATE(string, from_string, to_string)
Example 1:-
SQL> select translate(‘sqlandplsql’, ‘sql’, ‘sequel’) as str from dual;
STR
———–
seqandpqseq
Oracle first find all occurrence of string ‘sql’ and replaces with ‘sequel’. The above string has two occurrences and replaced both of them
Advertising