TRANSLATE
Purpose
This function replaces the characters out of from_string with the corresponding characters out of to_string in the string, expr.
Syntax
translate::=
Usage Notes
- The characters in
exprwhich do not exist infrom_stringare not replaced. - If
from_stringis longer thanto_string, then the relevant characters are deleted and not replaced. - If
to_stringis longer thanfrom_string, the relevant characters are ignored during the replacement process. - If one of the parameters is the empty string, then the result is
NULL.
Example
SELECT TRANSLATE('abcd','abc','xy') TRANSLATE;