SQL REPLACE() Function

SQL REPLACE() function return the string/char of every matched string replace with new string.

SQL REPLACE() function supported Oracle SQL version

  • Oracle 8i
  • Oracle 9i
  • Oracle 10g
  • Oracle 11g
  • Oracle 12c
  • Oracle 18c

Syntax

REPLACE(string, match_string, replace_string)

Parameters

  • string is original string.
  • match_string is find string from original string.
  • replace_string is if match_string found replace to replace_string string.

Example

Consider following example return the every matched string replace with new string.

SQL> SELECT REPLACE('Opal Kole','K','Smo') "REPLACE" FROM DUAL;

REPLACE
-----------
Opal Smoole