BYTE_SUBSTR64 and BYTE_SUBSTR Functions [String]

The BYTE_SUBSTR64 and BYTE_SUBSTR functions return the byte substring of the large object column or variable parameter.

Syntax

BYTE_SUBSTR64large-object-column, start, length )
BYTE_SUBSTRlarge-object-column, start, length )

Parameters

large-object-column – the name of a LONG VARCHAR or LONG BINARY 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 byte at position 1. A negative integer specifies a substring starting from the end of the string, with the final byte at position -1.

length – an integer expression indicating the length of the substring. A positive length specifies the number of bytes to return, starting at the start position. A negative length specifies the number of bytes to return, ending at the start position.

Usage

  • Nested operations of the functions BYTE_LENGTH64, BYTE_SUBSTR64, and BYTE_SUBSTR do not support large object columns or variables.
  • The BYTE_SUBSTR64 and BYTE_SUBSTR functions support both LONG BINARY and LONG VARCHAR columns and LONG BINARY and LONG VARCHAR variables of any size of data. Currently, a SQL variable can hold up to 2GB - 1 in length.