Returns the nth word from a character expression.
Category: | Character |
Returned data type: | NCHAR |
specifies any valid expression that evaluates to a character string.
Data type | DOUBLE |
See | <sql-expression> |
FedSQL Expressions |
is a nonzero numeric expression that specifies the number of the word in the character expression that you want SCAN to select. The following rules apply:
specifies any valid expression that evaluates to a character string and that SCAN uses as word separators in the expression.
Default | |
Requirement | If delimiter is a constant, enclose delimiter in single quotation marks. |
Interactions | ASCII default delimiters are: blank ! $ % & ( ) * + , – . / ; < |. In environments without the ^ character, SCAN uses the ~ character instead. |
EBCDIC default delimiters are: blank ! $ % & ( ) * + , – . / ; < ¬ | ¢. | |
Data type | NCHAR |
See | <sql-expression> |
FedSQL Expressions |
Statements
|
Results
|
---|---|
select scan('ABC.DEF(X=Y)', 3); |
X=Y |
select scan('ABC.DEF(X=Y)', -3); |
ABC |