The REPLACE Function : REPLACE « Character String Functions « Oracle PL/SQL Tutorial






The REPLACE function has the following general syntax:

REPLACE (string, look for, replace with)

All three arguments are necessary.

The 'look for' string will be replaced with the 'replace with' string every time it occurs.

SQL> SELECT REPLACE ('This is a test',' is ',' may be ') FROM dual;

REPLACE('THISISATE
------------------
This may be a test

SQL>








11.16.REPLACE
11.16.1.The REPLACE Function
11.16.2.If the look for string is not present, then the replacing does not occur
11.16.3.REPLACE(x, search_string, replace_string) searches x for search_string and replace it with replace_string.
11.16.4.select replace ('beer bucket','beer','milk') as replace_1
11.16.5.select replace ('beer bucket','beer') as replace_2
11.16.6.translate vs replace