The mi_type_maxlength() function

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

Syntax

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

Usage

The mi_type_maxlength() function obtains the maximum length of the data type from the type descriptor that type_desc references. The maximum length applies to the built-in data types VARCHAR and LVARCHAR. For extended data types, the maximum length is the value of the maxlen column of the sysxtdtypes system catalog table.

For GLS, the NVARCHAR data type also has a maximum length.

If you call mi_type_maxlength() on some other data type, the function returns zero.

Return values

>=0
The maximum length of the data type in the type_desc type descriptor.
MI_ERROR
The function was not successful.