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.