SUBSTRING function

SUBSTRING is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER), and extracts characters from a string to create another string.

SYNTAX

SUBSTRING returns a new string of the same type as source_string, containing one contiguous run of characters extracted from source_string as specified by start_position and string_length.

The start position can be negative. The start position and length define a range. The result is the overlap between this range and the input string.

If any parameter is NULL, the result is NULL. This is not a zero length string.

For example:
SUBSTRING('Hello World!' FROM 7 FOR 4)
returns 'Worl'.
Related concepts
ESQL overview
Related tasks
Developing ESQL
Selecting a subfield from a larger field
Manipulating messages in the BLOB domain
Related reference
Syntax diagrams: available types
ESQL string manipulation functions