informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_type_precision()

The mi_type_precision() function obtains the precision of a data type from its type descriptor.

Syntax

Usage

The mi_type_precision() function obtains the data type precision from the type descriptor that type_desc references. The precision is an attribute of the data type that represents the total number of digits the data type can hold, as follows.

Data Type Meaning
DECIMAL, MONEY Number of significant digits in the fixed-point or floating-point (DECIMAL) column
DATETIME, INTERVAL Number of digits that are stored in the date and/or time column with a specified qualifier
Character, Varying-character Maximum number of characters in the column

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

Return Values

>=0 is the precision of the data type in the type_desc type descriptor.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_type_align(), mi_type_byvalue(), mi_type_element_typedesc(), mi_type_full_name(), mi_type_length(), mi_type_maxlength(), mi_type_owner(), mi_type_qualifier(), mi_type_scale(), mi_type_typedesc(), and mi_type_typename().

For information on type-descriptor accessor functions, see Type Descriptors. For information on precision and scale, see Chapter 3, Using Numeric Data Types.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved