getSubString(long pos, int length) - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Retrieves all or part of the CLOB value that this Clob object represents as a string of characters.

Arguments

Argument Description
pos The position of the first character in the CLOB value to be extracted.

The first character is at position 1.

length The number of consecutive characters to be copied.

Return Value

The result string contains up to length consecutive characters from the CLOB value designated by this Clob object, starting with the character at position pos.

If the value of pos + length - 1 is larger than the length of the CLOB in characters, the length of the resulting string is less than length.

Exceptions

IF … THEN getSubString() throws an SQLException to …
there is an error accessing the CLOB value indicate a failure while the reading from Clob data, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7851
the value of the pos argument is less than 1

-or-

the value of the length argument is negative

indicate an invalid argument, setting the SQLException fields as follows:
  • SQLState Field = “22023”
  • vendorCode Field = 7859
the value of the length argument is too large for the current JVM to allocate the required memory for this function indicate that available JVM heap memory has run out, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7856