getResultSet_nD(List<Integer>, List<Integer>) - 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™

Retrieves a result set holding the elements of the slice of the n-D array that starts at the index specified by the coordinates in List lowerBounds and contains up to the total number of elements in the slice delimited by the coordinates in List upperBounds.

  • Teradata only supports standard mapping.
  • This method supports N-D arrays only.
  • This method is a Teradata extension.

A ResultSet object containing up to the full slice specified of the SQL array designated by this Array object, starting at the element referred to by lowerBound.

The result set has one row for each element of the SQL array, with the first row containing the element at the lower bound specified by lowerBounds.

The result set has up to the number of rows corresponding to the number of elements contained in the slice between lowerBounds and upperBounds. For n-D arrays, the column type of the first row is of List<Integer>, where the list contains n coordinates corresponding to the particular element being referenced.

For example, for a 2-D array, the List<Integer> column for a given row would consist of 2 elements (n,m). For a 5-D array, the List<Integer> column for a given row would consist of 5 elements (a,b,c,d,e).

The index values for the first column of the ResultSet are based on the lower and upper bounds defined for the array. Therefore, if the array type is defined with lower bounds that are some other value than 1, then the index values for the first column of the ResultSet will begin with that same lower bound accordingly.

The rows containing the array elements are output in row-major order.

Note that this routine may return less than the full slice of elements in the array. Any uninitialized elements in the array are not returned.

Syntax

ResultSet getResultSet_nD(List<Integer>  lowerBounds,
                          List<Integer>  upperBounds)
                          throws SQLException

Syntax Elements

lowerBounds
The array index of the first element to retrieve from the slice.
upperBounds
The array index of the last element to retrieve from the slice.

Exceptions

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