void FNC_GetStructuredAttributeInfo ( UDT_HANDLE udtHandle, int attributePosition, int bufSize, attribute_info_t *attributeArray )
- attributeArray
- Defined in sqltypes_td.h as:
typedef struct attribute_info_t { INTEGER attrIndex; dtype_et data_type; CHARACTER attribute_name[256]; SMALLINT udt_indicator; CHARACTER udt_type_name[256]; INTEGER max_length; FNC_LobLength_t lob_length; SMALLINT total_interval_digits; SMALLINT num_fractional_digits; charset_et charset_code; } attribute_info_t;
Syntax Elements
- udtHandle
- Handle to a structured UDT that is defined to be an input parameter to an external routine.
- attributePosition
- Whether this call returns information about one or all of the attributes:
attributePosition Description 0 or greater Value identifies position of attribute in structured UDT for which this call returns information. Position of first attribute is 0. -1 Call returns information about all attributes. - bufSize
- Size in bytes that was allocated to the attributeArray argument.
- attributeArray
- Array of one or more attribute_info_t structures that describe the requested attribute or attributes in the structured UDT, as specified by attributePosition.
- attrIndex
- Specifies the position of the attribute in the structured type, where the position of the first attribute is 0.
- data_type
- Specifies the data type of the attribute. The sqltypes_td.h header file defines dtype_et as:
typedef int dtype_et;
- attribute_name
- Specifies the attribute name.
- udt_indicator
- Specifies whether the attribute is a UDT and if so, which kind:
udt_indicator UDT Kind 0 Not a UDT 1 Structured UDT 2 Distinct UDT 3 Teradata proprietary internal UDT 5 JSON attribute - udt_type_name
- Specifies the UDT type name associated with the attribute. Meaningful only if the attribute is a UDT.
- max_length
- Specifies the maximum length in bytes of the value of the attribute:
Attribute Type max_length Non-LOB Size in bytes of buffer you must allocate before calling FNC_GetStructuredAttribute to get attribute value. LOB LOB_REF length lob_length provides length of LOB data itself.
JSON Maximum length of JSON attribute. - lob_length
- Specifies the length of a LOB attribute. Meaningful only if the attribute is a LOB.
- total_interval_digits
- Specifies the precision of certain attributes. The value of total_interval_digits corresponds to the n value of the following types:
- DECIMAL(n, m)
- INTERVAL YEAR(n)
- INTERVAL YEAR(n) TO MONTH
- INTERVAL MONTH(n)
- INTERVAL DAY(n)
- INTERVAL DAY(n) TO HOUR
- INTERVAL DAY(n) TO MINUTE
- INTERVAL DAY(n) TO SECOND(m)
- INTERVAL HOUR(n)
- INTERVAL HOUR(n) TO MINUTE
- INTERVAL HOUR(n) TO SECOND(m)
- INTERVAL MINUTE(n)
- INTERVAL MINUTE(n) TO SECOND(m)
- INTERVAL SECOND(n, m)
- num_fractional_digits
- Specifies the precision or scale of certain attributes. The value of num_fractional_digits corresponds to the m value of the following types:
- DECIMAL(n, m)
- TIME(m)
- TIME(m) WITH TIME ZONE
- TIMESTAMP(m)
- TIMESTAMP(m) WITH TIME ZONE
- INTERVAL DAY(n) TO SECOND(m)
- INTERVAL HOUR(n) TO SECOND(m)
- INTERVAL MINUTE(n) TO SECOND(m)
- INTERVAL SECOND(n, m)
- charset_code
- Specifies the server character set associated with the attribute. Meaningful only if the attribute is a character type.