/ Published in: SQL
A few examples of the TRANSLATE function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
--Example 1 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'o', 'X') AS TRANSLATE_TEST FROM dual; --Example 2 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'Is', 'SW') AS TRANSLATE_TEST FROM dual; --Example 3 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'IsC m', 'SWx2q') AS TRANSLATE_TEST FROM dual; --Example 4 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'omsi', '12') AS TRANSLATE_TEST FROM dual; --Example 5 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'omsi', '') AS TRANSLATE_TEST FROM dual; --Example 6 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, TRANSLATE('Complete IT Professional', 'x', 'a') AS TRANSLATE_TEST FROM dual; --Example 7 SELECT 'Complete IT Professional' AS SAMPLE_TEXT, REPLACE('Complete IT Professional', 'let', 'sip') AS REPLACE_TEST, TRANSLATE('Complete IT Professional', 'let', 'sip') AS TRANSLATE_TEST FROM dual;
URL: http://www.databasestar.com/oracle-translate/