How to perform a character wise replacement of a string in Oracle

In Oracle SQL/PL-SQL the TRANSLATE function performs a character wise replacement of a string. The syntax is: TRANSLATE( input_string , string1 , string2 )


- String1 is the string that will be searched for in input_string
- All characters in the String1 will be replaced with the corresponding character in the String2.



Example


SELECT TRANSLATE('PASSPORT', 'AR' ,'OO') FROM DUAL;


Result
------------
POSSPOOT

Comments

Popular posts from this blog

Create Tables in Oracle Database using TOAD

How to create Oracle stored Procedures using TOAD for Oracle

How to Create Packages in Oracle Database using TOAD for Oracle