TRANSLATE() returns a string where all occurrences of the from_template are replaced with corresponding characters in the to_template. : Translate « Char Functions « Oracle PL / SQL






TRANSLATE() returns a string where all occurrences of the from_template are replaced with corresponding characters in the to_template.

 

SQL>
Syntax: TRANSLATE(<string_expression>, <from_template>, <to_template>)
SQL>
SQL>
SQL> SELECT
  2       TRANSLATE ('4428-2174-5093-1501'
  3                 ,'0123456789-'
  4                 ,'XXXXXXXXXX*') hide_num
  5  FROM dual;

HIDE_NUM
-------------------
XXXX*XXXX*XXXX*XXXX

 








Related examples in the same category

1.from_template argument can contain more characters than to_template.
2.all dashes ("-") were dropped from the translated string, and the digit "9" was translated into an asterisk.
3.Translate: replaces a string character by character
4.TRANSLATE(x, from_string, to_string): Converts all occurrences of from_string in x to to_string
5.Using the TRANSLATE() Function: to encode and decode
6.Shifts the lowercase as well as uppercase characters in a column
7.TRANSLATE(): convert numbers
8.Use translate function in update statement
9.TRANSLATE('555-143-3344', '1234567890','XXXXXXXXXX') phone