The SUBSTRING function returns a variable-length character string of the LONG VARCHAR column or variable parameter. If any of the arguments are NULL, SUBSTRING returns NULL.
{ SUBSTRING | SUBSTR } ( long-varchar-column, start [, length ] )
long-varchar-column The name of a LONG VARCHAR column or variable.
start An integer expression indicating the start of the substring. A positive integer starts from the beginning of the string, with the first character at position 1. A negative integer specifies a substring starting from the end of the string, with the final character at position -1.
length An integer expression indicating the character length of the substring. A positive length specifies the number of characters to return, starting at the start position. A negative length specifies the number of characters to return, ending at the start position.
SUBSTRING supports LONG VARCHAR variables of any size of data. Currently, a SQL variable can hold up to 2GB - 1 in length. SUBSTRING does not support LONG BINARY variables or searching LONG BINARY columns.