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

mi_parameter_scale()

The mi_parameter_scale() function returns the scale of the column that is associated with a specified input parameter in a prepared statement.

Syntax

Usage

The mi_parameter_scale() function obtains the column scale of the column that is associated with param_id 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 scales of input-parameter columns in the zero-based parameter-scale array. To obtain information about the nth input parameter, use a param_id value of n-1.

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_parameter_scale() on 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_scale() raises an exception.

Return Values

0 indicates that the data type of the column associated with the specified input parameter is something other than DECIMAL or MONEY.
>0 is the scale of the DECIMAL or MONEY 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_precision(), 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