>>-REPLACE--(--expression1--,--expression2--,--expression3--)-->< |
The schema is SYSFUN.
Replaces all occurrences of expression2 in expression1 with expression3.
The first argument is a character string or binary string with a maximum length of 1048576 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.