SUBSTR, SUBSTRB, SUBSTRC, SUBSTR2, and SUBSTR4
The SUBSTR family of functions is one of the most common and useful set of character functions. The SUBSTR functions allow you to extract a subset of contiguous characters from a string. The substring is specified by starting position and length, and the functions differ in the units they use:
Starting position and length are in terms of characters.
Starting position and length are in terms of bytes. When you use a single-byte character set, SUBSTRB and SUBSTR will return the same results.
Starting position and length are in terms of Unicode characters, after any decomposed characters have been composed.
Starting position and length are in terms of code units.
Starting position and length are in terms of code points.
All of the function specifications follow the same pattern:
FUNCTION SUBSTR (
start_position_inIN NUMBER [,
substr_length_inIN NUMBER]) RETURN VARCHAR2
where the arguments are as follows:
The source string
The starting position of the substring in
The length of the substring desired (the number of characters to be returned in the substring)
The last parameter,
optional. If you do not specify a substring length, then SUBSTR
returns all the characters to the end of
string_in (from the starting position
substr_length_in argument, if present, must be greater than zero. ...