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

mi_column_precision()

The mi_column_precision() function obtains the precision of the specified column from a row descriptor.

Syntax

Usage

The mi_column_precision() function obtains the column precision of column_id in the row descriptor that row_desc references. The precision is an attribute of the column data type that represents the total number of digits the column 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 the specified qualifier
Character,
Varying-character
Maximum number of characters in the column

If you call mi_column_precision() on a column with some other data type, the function returns zero (0).

A row descriptor describes the structure of a row or a composite value. You can call either the mi_get_row_desc() or mi_get_row_desc_without_row() function to obtain the row descriptor.

Return Values

0 indicates that no precision was set for the specified column.
>0 is the precision of the specified column.
MI_ERROR indicates that the function was not successful.

Related Topics

See the description of the following functions: mi_column_id(), mi_column_name(), mi_column_nullable(), mi_column_scale(), mi_column_type_id(), mi_column_typedesc(), mi_get_row_desc(), and mi_get_row_desc_without_row().

For information about row descriptors and column information, see Using a Row Descriptor.


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