The mi_type_length() function

The mi_type_length() function obtains the length of a data type from its type descriptor.

Syntax

mi_integer mi_type_length(type_desc)
   MI_TYPE_DESC *type_desc;
type_desc
A pointer to the type descriptor from which to obtain the length.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_type_length() function determines the length for the data type that type_desc references. The length of the type can exceed the length of the data in the type. For extended data types, the length is the value of the length column of the sysxtdtypes system catalog table.

Return values

>=0
The length of the data type in the type_desc type descriptor.
MI_ERROR
The data type in type_desc is CHAR or NCHAR.