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 expr which do not exist in from_string are not replaced.
  • If from_string is longer than to_string, then the relevant characters are deleted and not replaced.
  • If to_string is longer than from_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;