16.20 - getResultSet(long, int, Map) - 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 subarray that starts at index and contains up to count successive elements.

  • Teradata only supports standard mapping. Any custom map provided in the call will be ignored.
  • This method only supports 1-D arrays.

Syntax

ResultSet getResultSet(long  index,
                       int  count,
                       Map<String,Class<?>>  map)
                       throws SQLException

Parameters

index
The array index of the first element to retrieve. The first element is at index 1.
count
The number of successive SQL array elements to retrieve.
map
The Map object that contains the mapping of SQL type names to classes in the Java programming language.

Return Value

A ResultSet object containing up to count consecutive elements of the SQL array designated by this Array object, starting at index.

The result set has one row for each element of the SQL array with the first row containing the element at index. The result set has up to count rows in ascending order based on the indices. Each row has two columns:
  • The first column stores the index into the array for that element.
  • The second column stores the element value.

Note that this routine may return less than count number 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 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 retrieve result set of Array elements>” is returned.