Substring functions

The built-in SQL substring functions return substrings from character string arguments, or return positional information for operations on substrings.

Read syntax diagramSkip visual syntax diagram
Substring Functions

      (1)                         (2)     
|--+-------| CHARINDEX function |-----+-------------------------|
   |  (1)                     (3)     |   
   +-------| INSTR function |---------+   
   |                   (4)            |   
   +-| LEFT function |----------------+   
   |                    (5)           |   
   +-| RIGHT function |---------------+   
   |                     (6)          |   
   +-| SUBSTR function |--------------+   
   |                      (7)         |   
   +-| SUBSTRB function |-------------+   
   |                        (8)       |   
   +-| SUBSTRING function |-----------+   
   |                              (9) |   
   '-| SUBSTRING_INDEX function |-----'   

Notes:
  1. Informix® extension
  2. See CHARINDEX function
  3. See INSTR function
  4. See LEFT function
  5. See RIGHT function
  6. See SUBSTR function
  7. See SUBSTRB function
  8. See SUBSTRING function
  9. See SUBSTRING_INDEX function

Sections that follow describe the syntax and usage of these substring functions.


Copyright© 2021 HCL Technologies Limited