16.20 - setArray(Object, long, int) - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

Purpose

Sets a slice of the SQL ARRAY value designated by this Array object, using the element values passed in arrayElements, beginning with the specified index and setting up to count successive elements of the SQL array.

  • This method supports 1-D arrays only.
  • If index is -1 or count is -1, the Array object is completely overwritten starting from the first element. Otherwise, the routine sets elements in the Array object starting from index, up to count elements. It may be possible that less than count elements are set.

Syntax

void setArray(Object  arrayElements,
              long  index,
              int  count)
              throws SQLException

Parameters

arrayElements
An Object consisting of a Java array of element values to be set.
index
The array index of the first element to set. The first element is at index 1.
count
The number of successive SQL array elements to set.

Exceptions

Throws SQLException in the following cases:
  • The method is called for an N-D array. A database specific code “9743 (ERRUDFJAVARRAY)< <Method> cannot be called for N-D Arrays >” is returned.
  • An error occurs while attempting to access the array. A database specific code “9743 (ERRUDFJAVARRAY) <Failed to set elements of the array>” is returned.