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

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.

Syntax

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

Parameters

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.

Return Value

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.

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.