Common Oracle Function Records

Source: Internet
Author: User

1. Oracle 's replace function and translate function

The Replace function is substituted at the string level, corresponding to the string one by one substitution

Sql> SELECT REPLACE ('accd','cd','EF '  from dual; REPLACE ('ACCD','CD','  EF')-------------------------ACEF

translate function is substituted at the character level, corresponding to character one by one substitution    translate (expr,from_string,to_string)  

 sql> select  translate ( " ACDD  , "   , "   EF  ) from   dual; TRANSLATE (  ACDD  , "  CD  ,  '  ef   '   ' ---------------------------aeff  

Translate function is empty at to_string position, the return value is null

Select Translate ('acdd','cd', ' from dual; TRANSLATE ('acdd','CD', ' )

There are special usages of # in translate, which begin with # to denote all characters

Sql>SelectTranslate'Liyan4h123ui','#liyanhui','#') fromdual; TRANSLATE ('Liyan4h123ui','#LIY------------------------------4123SQL>SelectTranslate'Liyan4h123ui','#liyanhui','#z') fromdual; TRANSLATE ('Liyan4h123ui','#LIY------------------------------z4123 SQL>SelectTranslate'Liyan4h123ui','#liyanhui','#zx') fromdual; TRANSLATE ('Liyan4h123ui','#LIY------------------------------zx4123x SQL>SelectTranslate'asadad434323','#0123456789','#') fromdual; TRANSLATE ('ASADAD434323','#012------------------------------Asadad

------to Be Continued

Common Oracle Function Records

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.