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

Teradata Vantage™ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

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.


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

Syntax Elements

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


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.