Replaces all occurrences of expression2 in expression1 with expression3.
The schema is SYSFUN.
The search is done using a binary comparison with no special consideration for multi-byte characters.
In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed. For a VARCHAR, the maximum length is 4 000 bytes, and for a CLOB or a binary string, the maximum length is 1 048 576 bytes. CHAR is converted to VARCHAR and LONG VARCHAR is converted to CLOB(1M).
The result can be null; if any argument is null, the result is the null value.
VALUES CHAR (REPLACE ('DINING', 'N', 'VID'), 10)
This
example returns the following output: 1
----------
DIVIDIVIDG
The output of the REPLACE function is VARCHAR(4000).
For this example, the CHAR function has been used to limit the output
of REPLACE to 10 bytes.