|
SQL>
SQL> –Using the TRANSLATE() Function
SQL>
SQL> –TRANSLATE(x, from_string, to_string) to convert the occurrences of characters in from_string found in x to corresponding characters in to_string.
SQL>
SQL> –TRANSLATE(): shift each character in the string SECRET MESSAGE: MEET ME IN THE PARK by four places to the right: A becomes E, B becomes F
SQL>
SQL> SELECT TRANSLATE(‘SECRET MESSAGE: MEET ME IN THE PARK‘,
2 ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ‘,
3 ‘EFGHIJKLMNOPQRSTUVWXYZABCD‘) FROM dual;
TRANSLATE(‘SECRETMESSAGE:MEETMEINTH
———————————–
WIGVIX QIWWEKI: QIIX QI MR XLI TEVO
SQL>
SQL> –select translate(‘www.java2s.com‘,’wjavscom‘,’abced123‘) from dual;
SQL>
SQL>
|
Tags: Char Functions, Code, Oracle PL / SQL, to encode and decode, Translate, Translate laquo Char Functions laquo Oracle PL SQL, Using the TRANSLATE Function
Posted in Uncategorized |
This entry was posted
on Tuesday, August 4th, 2009 at 9:05 pm and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.