setBytes(int objNum, byte[] data) - 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™

Stores intermediate results specified by data into the aggregate storage area.

Each time the UDF is called during the AGR_DETAIL aggregation phase, it must accumulate the row data passed in through arguments into the intermediate aggregate storage area for the specific group. Each group being aggregated to has a separate intermediate storage area.

Syntax

setBytes(int objNum, byte[] data)

Syntax Elements

objNum
Aggregate UDFs must pass a value of 1 for the objNum argument. Other values are reserved for future releases.
data
If data specifies a null byte array, setBytes() sets the aggregate storage area to zero.

Exceptions

If the serialized size of data is larger than the size specified in the CLASS AGGREGATE clause of the CREATE FUNCTION or REPLACE FUNCTION statement for the UDF, setBytes() throws an SQLException to indicate an overflow condition, setting the SQLException fields as follows.

SQLState Field vendorCode Field
“TS000” 7847