>>-REPLACE--(--expression1--,--expression2--,--expression3--)--><
The schema is SYSFUN.
Replaces all occurrences of expression2 in expression1 with expression3.
The first argument can be of any built-in character string or binary string type. 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 second and third arguments are identical to the first argument.
The result of the function is:
The result can be null; if any argument is null, the result is the null value.
Example:
VALUES CHAR (REPLACE ('DINING', 'N', 'VID'), 10)
This example returns the following:
1 ---------- DIVIDIVIDG
As mentioned, the output of the REPLACE function is VARCHAR(4000). For the above example the function CHAR has been used to limit the output of REPLACE to 10 bytes.