SUBSTRING64 function

Function

The SUBSTRING64 function returns a variable length character string of the LONG VARCHAR column parameter.

Syntax

SUBSTRING64large-object-column, start [, length ] )

Parameters

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.

Example

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’

Usage