Translate function Oracle

Published on by LakshmiSaahul,Dhana Royal

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
To be informed of the latest articles, subscribe:
Comment on this post