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

mi_column_scale()

The mi_column_scale() function obtains the scale of the specified column from a row descriptor.

Syntax

Usage

The mi_column_scale() function obtains the column scale of column_id in the row descriptor that row_desc references. The scale is an attribute of the data type. The meaning of the scale depends on the associated data type, as the following table shows.

Data Type Meaning of Scale
DECIMAL (fixed-point),
MONEY
The number of digits to the right of the decimal point
DECIMAL (floating-point) The value 255
DATETIME, INTERVAL The encoded integer value for the end qualifier of the data type; end_qual in the qualifier: start_qual TO end_qual

If you call mi_column_scale() on 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 the data type of the specified column is something other than DECIMAL, MONEY, FLOAT, or SMALLFLOAT.
>0 is the scale 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_precision(), 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