Oracle _ single row function _ character Function

Source: Internet
Author: User

Character Functions
1. ASCII (x) and chr (x)
ASCII (x): returns the ASCII code of character x.
Chr (x): returns characters with an ASCII code of x.
2. concat (x, y)
Used to add y to x, same as |
3. initcap (x)
Converts the first letter of each word in x to uppercase.
4. instr (x, find_string [, start] [, occurence])
Search for find_string in x and return the position of find_string.
Optional parameter start: Specifies the position in x for search.
Optional parameter occurence: Specifies the position where find_string appears.
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 the letters in x to lowercase, not letters.
Upper (x): converts letters in x into uppercase letters.
7. lpad (x, width [, pad_string]) and rpad (x, width [, pad_string])
Lpad (x, width [, pad_string]): Fill the left side of x with spaces to make the total length reach width
Optional parameter pad_string: if given, pad the left side of x with the pad_string character
Rpad (x, width [, pad_string]): Fill the right side of x with spaces to make the total length reach width characters
Optional parameter pad_string: if given, add the pad_string character to the right of x.
8. ltrim (x [, trim_string]), rtrim (x [, trim_string]), and trim (x [, trim_string])
Ltrim (x [, trim_string]): used to remove spaces from the left of x.
Optional parameter trim_string: if specified, the trim_string characters are truncated from the left side of x.
Rtrim (x [, trim_string]): used to remove spaces from the right of x.
Optional parameter trim_string: if specified, some trim_string characters are truncated from the right side of x.
Trim (x [, trim_string]): used to remove spaces from the left and right sides of x.
Optional parameter trim_string: if specified, the trim_string characters are truncated from the left and right sides of x.
9. nvl (x, value) and nvl2 (x, value1, value2)
Nvl (x, value): used to convert a null value into a known value. If x is null, value is returned. Otherwise, x is returned.
Nvl2 (x, value1, value2): determines whether x is null. If x is not null, value1 is returned; otherwise, value2 is returned.
10. replace (x, search_string, repalce_string)
Search for search_string in x and replace it with replace_string
11. soundex (x)
Used to obtain a string containing the pronunciation of x. This function is used to compare words with different spelling but similar pronunciation.
12. substr (x, start [, length])
Obtains a substring from x starting from the start position.
Optional parameter length: the length of the sub-string. If not specified, it is obtained until the end of the string.

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.