TextFunctions CheatSheet
TextFunctions CheatSheet
SUBSTR:
Extracts a portion of a string.
Syntax:
SUBSTR(original_string,position[,substring_length])
If position is negative Oracle counts backward from the end of the original string.
The substring_length parameter is optional. If it is omitted, the function returns all characters to the end of original_string.
UPPER:
Returns the string with all letters uppercase.
Syntax:
UPPER(original_string)
LOWER:
Returns the string with all letters lowercase.
Syntax:
LOWER(original_string)
INITCAP:
Returns the string with the first letter of each word in uppercase, all other letters in lowercase.
Syntax:
INITCAP(original_string)
REPLACE:
Returns the string with every occurrence of search_string replaced with replacement_string. If replacement_string is omitted or null,
then all occurrences of search_string are removed from the original string.
Syntax:
REPLACE(original_string,search_string,replacement_string)
TRANSLATE:
Returns the string with every occurrence of each character in from_string replaced with its corresponding character in to_string. If
to_string is an empty string or null, the function returns null. Characters at the end of from_string that don’t have a corresponding
character in to_string are removed from the original string.
Syntax:
TRANSLATE(original_string,from_string,to_string)
LENGTH:
Returns the length of the string.
Syntax:
LENGTH(string)
INSTR:
Returns the position in which one string is found within another string.
Syntax:
INSTR(main_string,substring[,position[,occurrence]])
sql.standout-dev.com
The position and occurrence parameters are optional. If position is omitted the search starts at the beginning of the main string. If
occurrence is omitted the function returns the position of the first occurrence of the substring.
If position is a negative number, then the start position is counted backwards from the end of the string.
If the substring is not found within the main string the function returns 0.
sql.standout-dev.com