11.13. STRING Manipulation Functions
11.13.1. SUBSTR
SUBSTR(str, start_char, [no_of_chars])
str | varchar2 | The input string. |
start_pos | integer | Go to the START_POS character position in the string and count forward, NO_OF_CHARS. If START_POS is negative, start from the tail of the string. |
no_of_chars | integer | Number of characters to select. If not specified, then get the rest of the string. |
retuns | varchar2 | Returns the substring or NULL. |
The SUBSTR function returns a slice of an input string. The arguments START_POS and NO_OF_CHARS can be literals, variables, or string expressions that evaluate to a number. The following are some SUBSTR examples in a SQL*Plus session.
Given the string, 12345, select the tail of the string starting at character position 2. ...
Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.