The character function of Oracle single-line function

Source: Internet
Author: User

lower--Convert to lowercase

upper--Convert to uppercase

initcap--First Letter Capital

concat--Connection Characters

substr--Intercept characters

length/length--Get string Length (bytes length)

instr--where the specified character is located

lpad/rpad--Left/Right padding

trim--removing characters from both ends of a string

replace--replacing a specified character

Demo:

1Sql> Select Lower('Hello World'),Upper('Hello World'), Initcap ('Hello World') fromdual;2  3 LOWER('HELLOWORLD')UPPER('HELLOWORLD') Initcap ('HELLOWORLD')4 ------------------- ------------------- ---------------------5 Hello World, Hello World, hello World6  7Sql> SelectConcat'Hello',' World') fromdual;8  9CONCAT ('HELLO',' World')Ten ----------------------- One Helloworld A   -Sql> SelectSubstr'Hello World',4), substr ('Hello World',4,4) fromdual; -   theSUBSTR ('HELLOWORLD',4) SUBSTR ('HELLOWORLD',4,4) - ---------------------- ------------------------ - Lo World Lo w -  +   -Sql> SelectLength'Hello World'), LENGTHB ('Hello World'), Length ('Wuhan'), LENGTHB ('Wuhan') fromdual; +   ALENGTH ('HELLOWORLD') LENGTHB ('HELLOWORLD') LENGTH ('Wuhan') LENGTHB ('Wuhan') at -------------------- --------------------- -------------- --------------- -                    One                     One              2               6 -   -Sql> SelectInStr'Hello World','W') fromdual; -   -INSTR ('HELLOWORLD','W') in ----------------------- -                       7 to   +Sql> SelectLpad ('Hello',Ten,'*'), Rpad ('Hello',Ten,'*') fromdual; -   theLpad ('HELLO',Ten,'*') Rpad ('HELLO',Ten,'*') * -------------------- -------------------- $ *****Hello Hello*****Panax Notoginseng   -Sql> SelectTrim'H'  from 'Hello World HHHH') fromdual; the   +TRIM ('H' from'helloworldhhhh') A ----------------------------- the Ello World +   -Sql> Select Replace('Hello World','L','*') fromdual; $   $ REPLACE('HELLOWORLD','L','*') - ----------------------------- -He**o WOR*D

The character function of Oracle single-line function

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: info-contact@alibabacloud.com 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.