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

Advertisements

About Oracle Technology Blogs
Oracle Application Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: