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

mi_parameter_precision()

The mi_parameter_precision() function obtains the precision of the column associated with the specified input parameter in a prepared statement.

Syntax

Usage

The mi_parameter_precision() function obtains the precision of the column that is associated with the param_id input parameter from the statement descriptor that stmt_desc references. This function is an accessor function for a statement descriptor, which describes a prepared statement. The statement descriptor stores information about the precisions of input-parameter columns in the zero-based parameter-precision array. To obtain information about the nth input parameter, use a param_id value of n-1.

The precision is an attribute of the column data type that represents the total number of digits the column associated with an input parameter 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_parameter_precision() on an input parameter whose column is some other data type, the function returns zero (0).

Parameter information is available only for the INSERT and UPDATE statements. Support for the UPDATE statement includes the following forms of UPDATE:

If you attempt to request parameter information for other SQL statements, mi_parameter_precision() raises an exception.

Return Values

0 indicates that no precision was set for the column of the specified input parameter.
>=0 is the precision of the column that is associated with the specified input parameter.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_close_statement(), mi_exec_prepared_statement(), mi_fetch_statement(), mi_get_statement_row_desc(), mi_parameter_count(), mi_parameter_nullable(), mi_parameter_scale(), mi_parameter_type_id(), mi_parameter_type_name(), mi_prepare(), and mi_statement_command_name().


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