setBytes(long pos, byte[] bytes) - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Appends the given array of bytes to the end of the BLOB value that this Blob object represents and returns the number of bytes written.

If successful, setBytes() returns the number of bytes written.

Syntax

setBytes(long pos, byte[] bytes)

Syntax Elements

pos
Reserved for future use.
bytes
The array of bytes to append to the BLOB value that this Blob object represents.

Exceptions

IF … THEN setBytes() throws an SQLException to …
there is an error accessing the BLOB value indicate a failure while writing data into a LOB, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7852
the bytes argument is null

-or-

the value of the pos argument is less than 1

indicate a call to a Blob or Clob method with invalid parameters, setting the SQLException fields as follows:
  • SQLState Field = “22023”
  • vendorCode Field = 7859
the JVM cannot allocate enough memory for the method to write the bytes to the Blob indicate that available JVM heap memory has run out, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7856