The SUBSTRING64 function returns a variable-length character string of the large object column or variable parameter.
large-object-column – the name of a LONG VARCHAR or LONG BINARY column or variable.
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.
Values returned by SUBSTRING64, given a column named col1 that contains the string ("ABCDEFG"):
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"