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

mi_type_scale()

The mi_type_scale() function obtains the scale of the data type from its type descriptor.

Syntax

Usage

The mi_type_scale() function obtains the data type scale from the type descriptor that type_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_type_scale() on some other data type, the function returns zero (0).

Return Values

>=0 is the scale 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_precision(), mi_type_qualifier(), 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