Sort out Oracle11G Functions

Source: Internet
Author: User
Returns the character functions 1, CHR (n) [n is a positive integer. If ngt; 256, MOD (n, 256)] selectCHR (65) a1, CHR (67) | CHR (65) | CHR (84) a2FR

Returns the character functions 1, CHR (n) [n is a positive integer. If ngt; 256, MOD (n, 256)] select CHR (65) a1, CHR (67) | CHR (65) | CHR (84) a2 FR

Character functions that return characters

1. CHR (n) [n is a positive integer. If n> 256, go to MOD (n, 256)]

2. CONCAT (separator, ch2) concatenated string [cha1, ch2 is any character CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, NCLOB]

CONCAT (CLOB, NCLOB) returns NCLOB

CONCAT (NCLOB, NCHAR) returns NCLOB

CONCAT (NCLOB, CHAR) returns NCLOB

CONCAT (NCHAR, CLOB) returns NCLOB

3. INITCAP (ch): upper-case letters at a time, and lower-case letters at a time

4. LOWER (ch) converts string to lowercase

5. LPAD (expr1, n, expr2) truncates n characters from expr1 and returns the result. If the length is insufficient, use expr2 to fill the left.

6. LTRIM (ch, set) removes the characters contained in the set on the left of the string ch. If the set is not specified for the stock, it is a space. If there are other intervals in the middle, the truncation is stopped.

7. NCHR (n) is equivalent to CHR (n USINGNCHAR_CS)

8. NLS_INITCAP (ch, nlspara) is used to uppercase the first letter of a string word and the other lowercase letters. You can specify the sorting rule nlspara, or you can choose not to specify the default rule.

9. NLS_LOWER (ch, nlspara) converts the string to lowercase letters. You can specify the sorting rules.

10. NLS_UPPER (ch, nlspara) converts a string to uppercase letters. You can specify the sorting rules.

11. NLSSORT (ch, nlspara) returns the bytecode of the string. Used for sorting



12. REGEXP_REPLACE (ch_source, pattern) Regular Expression replacement

13. REGEXP_SUBSTR (ch_source, pattern) Regular Expression Truncation

14. REPLACE (ch, search_string, replace_string) string replacement

15. RPAD (expr1, n, expr2) truncates n characters from expr1 and returns the result. If the length is not enough, use expr2 to fill the right. The space is filled by default.

16. RTRIM (ch, set) removes the characters contained in the set on the right of the string ch. If the set is not specified for the stock, it is a space. If there are other intervals in the middle, the truncation is stopped.

17. SOUNDEX (ch) returns the voice representation of the string parameter, which is useful for spelling different words and is not very useful in Chinese environments.

18. SUBSTR (ch, position, length) truncates a string.

19. The functions of TRANSLATE (ch, from_string, to_string) and REPLACE functions are similar.

For ch strings, replace the strings in from_string with to_string

20. TREAT

21. TRIM (ch fromsource_string) removes the ch

TRIM (LEADINGch fromsource_string) Remove the left ch

TRIM (TRAILINGch fromsource_string) Remove the right ch

TRIM (BOTHch fromsource_string) removes the ch

22. Convert UPPER (ch) to uppercase

The character function returns a number.

1. ASCII (ch) returns the ASCII code of a character. ch can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2.

2. In the source, INSTR (source, ch, position, n) searches for ch from the position, and returns 0 if no match exists, the first appearance starts from 1 by default.

3. LENGTH (ch) returns the string LENGTH.

4. REGEXP_COUNT (source_string, pattern, position, match_para)

Regular Expression rules match the number of times a string appears in the original string

5. REGEXP_INSTR (source_string, pattern) Regular Expression matches string position

NLS character Functions

1. NLS_CHARSET_DECL_LEN (byte_count, char_set_id)

Returns the declared length (the number of characters) of an NCHAR column ). The byte_count parameter is the column width. The 'Char _ set_id 'parameter is the character set ID.

2. NLS_CHARSET_ID (string) returns the Character Set ID corresponding to the character set name.

3. NLS_CHARSET_NAME (number) returns the character set name corresponding to the Character Set ID.

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.