1 --translate(x, from_string, to_string) 2 --函数在x中查找from_string中的字符,并替换成to_string中对应的字符 3 --下面是使用translate函数的实例: 4 5 --编码 6 select translate('SECRET MESSAGE: MEET ME IN THE PARK', 7 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ', 8 'EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD') 9 from dual;10 11 --运行结果12 -- WIGVIX QIWWEKI: QIIX QI MR XLI TEVO13 14 --译码15 select translate('WIGVIX QIWWEKI: QIIX QI MR XLI TEVO',16 'EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD',17 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')18 from dual;19 --运行结果20 --SECRET MESSAGE: MEET ME IN THE PARK