Syntax - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantage™
void
FNC_GetArrayTypeInfo_EON ( ARRAY_HANDLE       aryHandle,
                           array_info_eon_t  *arrayInfo,
                           bounds_t          *arrayScope)
arrayInfo
Defined in sqltypes_td.h as:
typedef struct array_info_eon_t {
   int numDimensions;
   int totalNumElements;
   element_info_eon_t elementInfo;
} array_info_eon_t;
arrayScope
Defined in sqltypes_td.h as:
typedef struct bounds_t {
   int lowerBound;
   int upperBound;
} bounds_t;
You must declare the arrayScope array as follows:
bounds_t arrayScope[FNC_ARRAYMAXDIMENSIONS];
elementInfo
Defined in sqltypes_td.h as:
typedef struct element_info_eon_t {
   dtype_et data_type;
   SMALLINT udt_indicator;
   [ CHARACTER udt_type_name[FNC_MAXNAMELEN_EON]; ]
   INTEGER_td max_length;
   SMALLINT total_interval_digits;
   SMALLINT num_fractional_digits;
   charset_et charset_code;
} element_info_eon_t;

Syntax Elements

aryHandle
The handle to an ARRAY type that is defined to be an input parameter to an external routine.
arrayInfo
Pointer to the buffer that will hold the information about the ARRAY input parameter.
For more information about dtype_et, total_interval_digits, num_fractional_digits, or charset_et, see FNC_GetStructuredAttributeInfo_EON.
arrayScope
An array of bounds_t structures that describes the scope of each dimension in an n-D ARRAY. If the ARRAY type is 1-D, then the default scope information for that single dimension (beginning with 1, ending with n, where n is the size of the ARRAY) is provided in the first cell of the arrayScope array. If the ARRAY type is n-D, then subsequent dimension information is placed in cells 2 to 5 as needed, and provides the beginning and ending bound for each dimension.
The array has a size of FNC_ARRAYMAXDIMENSIONS, which is set to the value 5 to indicate that an ARRAY may have a maximum of 5 dimensions.
numDimensions
Number of dimensions defined for the ARRAY type.
totalNumElements
Total number of elements (across all dimensions) defined for the ARRAY type. This is also known as the maximum cardinality of the ARRAY type.
lowerBound
Lower bound of a dimension.
upperBound
Upper bound of a dimension.
data_type
Data type of the elements of the ARRAY.
udt_indicator
Indicates kind of UDT:
udt_indicator UDT Kind
0 Not a UDT
1 Structured UDT
2 Distinct UDT

For distinct types, the data type returns the underlying type of the distinct type UDT.

3 Internal UDT
4 Array Type
udt_type_name
[Required if parameter is a UDT, disallowed otherwise]. UDT type name associated with the element.
max_length
Maximum length in bytes of an element value.
You can use max_length as the size in bytes of the buffer you need to allocate before you make a call to FNC_GetArrayElement to get the values of one element of an ARRAY.
total_interval_digits
Precision value for certain element types. For example, the value n in a DECIMAL(n,m) type or in INTERVAL DAY(n) TO SECOND(m). The list of types that use this value is the same as that of attribute_info_t.total_interval_digits.
num_fractional_digits
Precision or scale value for certain element types. For example, the value m in a DECIMAL(n,m) type or in INTERVAL DAY(n) TO SECOND(m). The list of types that use this value is the same as that of attribute_info_t.num_fractional_digits.
charset_code
Server character set associated with the element if the element is a character type.