REPLACE

The REPLACE function returns a specified character each time a specified string is replaced with another string; or removes all occurrences of a specified string.

REPLACE provides functionality related to that provided by the TRANSLATE function. TRANSLATE provides single-character, one-to-one substitution. REPLACE lets you substitute one string for another as well as to remove character strings.

See:

REPLACE function in Oracle Database SQL Language Reference for more details.

Return Value

The same data type as char.

Syntax

REPLACE ( char, search_string [, replacement_string ])

Parameters

char

A text expression that is the character that you want returned when a replacement is made.

search_string

A text expression that is the string you want to replace. When you specify NA, then the function returns char.

replacement_string

A text expression that is the string with which you want to replace search_string. When you do not specify a value for this argument or when you specify the value of NA, all occurrences of search_string are removed.