Oracle's Single-line functions: Character functions

Source: Internet
Author: User
Tags chr rtrim trim

Character function

1.ASCII (x) and Chr (x)

ASCII (x): Returns the ASCII code for the character X

Chr (x): Returns a character with an ASCII code of X

2.concat (X,y)

Used to add Y to X after, with | | function as

3.initcap (x)

Converts the first letter of each word in X to uppercase

4.instr (X,find_string[,start][,occurence])

Find find_string in X, return the location of find_string

Optional parameter start: Describes where to start looking from X, the first position is 1.

Optional parameter occurence: Description should return the first occurrence of find_string

5.length (x) and LENGTHB (x)

Length (x): Returns the number of characters in X

LENGTHB (x): Returns the number of bytes in X

6.lower (x) and upper (X)

Lower (x): Converts letters in x to lowercase, non-letter conversions

Upper (x): Converts letters in X to uppercase

7.lpad (x, Width [, pad_string]) and Rpad (X,width[,pad_string])

Lpad (x, Width [, pad_string]): Used to make the left of x blank space, so that the total length reached the width of the characters

Optional parameter pad_string: If given, the left of X is padded pad_string character

Rpad (X,width[,pad_string]): For the right of x to padded space, so that the total length of the width of the characters

Optional parameter pad_string: If given, the right of X is padded with pad_string characters

8.ltrim (x[,trim_string]), RTrim (x[,trim_string]) and trim (x[,trim_string))

LTrim (x[,trim_string]): Used to truncate some spaces from the left side of X

Optional parameter trim_string: If given, truncate some trim_string characters from the left side of X

RTrim (x[,trim_string]): Used to truncate some spaces from the right side of X

Optional parameter trim_string: If given, the trim_string characters are truncated from the right of X

Trim (x[,trim_string]): Used to truncate some spaces from the left and right sides of X

Optional parameter trim_string: If given, cut some trim_string characters from the left and right sides of X

9.NVL (X,value) and NVL2 (x,value1,value2)

NVL (X,value): is used to convert a null value to a known value, and if x is null, return value, otherwise return x

NVL2 (x,value1,value2): Determines whether x is null, if x is not empty, returns VALUE1, otherwise returns value2

10.replace (x,search_string,repalce_string)

Used to find search_string in X and replace it with replace_string

11.soundex (x)

Used to get a string containing the x pronunciation that is used to compare words that are different in spelling but have a similar pronunciation

12.substr (X,start[,length])

Used to get a substring from the start position from X

Optional parameter length: Specifies the length of the substring, if not given, until the end of the string

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

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: 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.