Skip Headers
Previous
Previous
 
Next
Next


SUBSTR

SUBSTR returns a portion of string, beginning at a specified character position and extending a specified number of characters.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

{ SUBSTR | SUBSTRB | SUBSTRC }(char, position [, substring_length ])

Arguments

char is a text expression that provides the base string from which the substring is derived.

position identifies the first character of the substring:

substring_length is the number of characters in the returned string. By default, the function returns all characters to the end of the base string. If you specify a value less than 1, then the function returns a null.

Examples

SUBSTR('firefly', 1, 4) returns the substring fire.

SUBSTR('firefly', -3, 3) returns the substring fly.