DSQL, PSQL
Syntax
Result type
VARCHAR
or BLOB
Description
Replaces all occurrences of a substring in a string.
This function fully supports text
BLOB
s of any length and character set.If find is the empty string, str is returned unchanged.
If any argument is
NULL
, the result is alwaysNULL
, even if nothing would have been replaced.
Examples
replace ('Billy Wilder', 'il', 'oog') -- returns 'Boogly Woogder'
replace ('Billy Wilder', 'il', '') -- returns 'Bly Wder'
replace ('Billy Wilder', 'il', null) -- returns NULL
replace ('Billy Wilder', 'xyz', null) -- returns NULL (!)
When used on a |
See also