The SUBSTRING64 function returns a variable length character string of the LONG VARCHAR column parameter.
SUBSTRING64( large-object-column, start [, length ] )
large-object-column The name of a LONG VARCHAR column.
start An 8 byte integer indicating the start of the substring. SUBSTRING64 interprets a negative or zero start offset as if the string were padded on the left with “non-characters.” The first character starts at position 1.
length An 8 byte integer indicating the length of the substring. If length is negative, an error is returned.
Given a column named col1 which contains the string (‘ABCDEFG’), the SUBSTRING64 function returns the following values:
SUBSTRING64( col1, 2, 4 )
returns
the string ‘BCDE’
SUBSTRING64( col1, 1, 3 )
returns
the string ‘ABC’
SUBSTRING64( col1, 0, 3 )
returns
the string ‘AB’
SUBSTRING64( col1, -1, 3 )
returns
the string ‘A’
If any of the arguments are NULL, SUBSTRING64 returns NULL.
Nesting of the functions SUBSTRING64, SUBSTRING, BYTE_SUBSTR, and BYTE_SUBSTR64 is not supported.
SUBSTRING64 also supports the LONG BINARY data type.