17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

You can use FNC_GetAnyTypeParamInfo but it truncates a retrieved UDT Name after 30 characters. Use FNC_GetAnyTypeParamInfo_eon instead of FNC_GetAnyTypeParamInfo for longer object names.

To get information about the TD_ANYTYPE input and output arguments passed to an external routine:

  1. Declare an integer variable, such as numAnytypeParams.
  2. Allocate sufficient memory for the AnyTypeAttributeArray buffer to hold information for all of the TD_ANYTYPE input and result parameters declared in your routine. This should be an array of anytype_param_info_t structures, where each element of the array will contain the information for a particular TD_ANYTYPE parameter.
  3. Call FNC_GetAnyTypeParamInfo() and pass in a pointer to the AnyTypeAttributeArray buffer along with the size of the buffer, and a pointer to numAnytypeParams.

The FNC_GetAnyTypeParamInfo function fills the AnyTypeAttributeArray buffer with information about each TD_ANYTYPE parameter. The information for the return type of a TD_ANYTYPE result parameter is contained in the last element of the array. The number of TD_ANYTYPE parameters is returned in the numAnyTypeParams parameter.

Be sure to free the memory allocated to the AnyTypeAttributeArray buffer when you have completed processing the information.