setBytes(long pos, byte[] bytes, int offset, int len) - Teradata Vantage - Analytics Database

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2026-03-06
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantage™

Appends all or part of the given byte array 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 appended.

Syntax

setBytes(long pos, byte[] bytes, int offset, int len)

Syntax Elements

pos
Reserved for future use.
bytes
The array of bytes to append to the BLOB value that this Blob object represents.
offset
The offset into the bytes argument at which to start reading the bytes to append.
len
The number of bytes from the bytes argument to append to the BLOB value.

Exceptions

IF … THEN setBytes() throws an SQLException to …
there is an error accessing the BLOB value indicate a failure while writing to the BLOB, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7852
the JVM cannot allocate enough memory for the method to write the bytes to the Blob indicate that the available JVM heap memory has run out, setting the SQLException fields as follows:
  • SQLState Field = “TS000”
  • vendorCode Field = 7856
one of the following:
  • the bytes argument is null
  • the value of the offset argument is negative
  • the value of the len argument is negative
  • the value of the pos argument is less than 1
  • the value of offset + len is larger than the length of the bytes argument
indicate a call to a Blob or Clob method with an invalid argument, setting the SQLException fields as follows:
  • SQLState Field = “22023”
  • vendorCode Field = 7859