Specify column substrings

In a query (or in any SQL statement containing an embedded SELECT statement), you can use bracket ( [ ] ) symbols to specify that only a subset of the data in a column of a character data type is to be retrieved. A column expression that includes brackets to signify a subset of the data in the column is known as a column substring.

The syntax of a column substring is as follows.
Read syntax diagramSkip visual syntax diagram
                          (1)   
>>-| Expression segment |--------------------------------------->

>--column--+----------------------+----------------------------><
           '-[--first--,--last--]-'   

Notes:
  1. See IBM® Informix® Guide to SQL: Syntax.
Element
Description
column
Identifier of a column within a database table or view
first. last
Positions of the first and the last byte of the retrieved substring

Copyright© 2018 HCL Technologies Limited