Skip Headers
Oracle® OLAP Expression Syntax Reference
Release 11.2

Part Number E23381-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

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.