SUBSTRING64 Function [String]

The SUBSTRING64 function returns a variable-length character string of the large object column or variable parameter.

Syntax

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

Parameters

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.

Example

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"

Usage

  • If any of the arguments are NULL, SUBSTRING64 returns NULL.

  • Nested operations of the functions SUBSTRING64, SUBSTRING, SUBSTR, BYTE_SUBSTR, and BYTE_SUBSTR64 do not support large object columns or variables.

  • SUBSTRING64 supports searching LONG VARCHAR and LONG BINARY columns and LONG VARCHAR and LONG BINARY variables of any size of data. Currently, a SQL variable can hold up to 2GB - 1 in length.