Returns a portion of character data. The portion of data returned begins at the specified position and is the specified substring length characters long. SUBSTR
calculates lengths using characters as defined by the input character set.
Syntax
Restrictions
The following restrictions apply when you use the SUBSTR
function in the SELECT
command:
The function supports only positive integers. It does not support negative values or floating-point numbers.
The SELECT
command does not support the following functions: SUBSTRB
, SUBSTRC
, SUBSTR2
, and SUBSTR4
.
Example
This example shows each problem_key
starting with the fifth character in the key.
select substr(problem_key, 5) from problem;