This Oracle tutorial explains how to use the Oracle/PLSQL SUBSTR function with syntax and examples.
The Oracle/PLSQL SUBSTR functions allows you to extract a substring from a string.
The syntax for the SUBSTR function in Oracle/PLSQL is:
The source string.
The starting position for extraction. The first position in the string is always 1.
Optional. It is the number of characters to extract. If this parameter is omitted, the SUBSTR function will return the entire string.
The SUBSTR function returns a string value. If length is a negative number, then the SUBSTR function will return a NULL value.
The SUBSTR function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle SUBSTR function examples and explore how to use the SUBSTR function in Oracle/PLSQL.
For example: