16.20 - getResultSet(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 that contains the elements of the SQL ARRAY value designated by this Array object.

  • 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(Map<String,Class<?>>  map)
                       throws SQLException

Parameters

map
The mapping of SQL user-defined types to classes in the Java programming language.

Return Value

A ResultSet object containing one row for each of the elements in the array designated by this Array object.

The result set contains one row for each array element, with two columns in each row:
  • The first column is of type Integer and stores the index into the array for that element, with the first array element being at index 1.
  • The second column stores the element value.

The rows are in ascending order corresponding to the order of the indices.

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.