The mi_fp_setargscale() function

The mi_fp_setargscale() accessor function sets the scale of an argument of a user-defined routine in its associated MI_FPARAM structure.

Syntax

void mi_fp_setargscale(fparam_ptr, arg_pos, arg_scale)
   MI_FPARAM *fparam_ptr;
   mi_integer arg_pos;
   mi_integer arg_scale;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
arg_pos
The index position into the argument-scale array for the argument whose scale you want to set.
arg_scale
The integer scale, in number of digits, to set for the arg_pos+1 argument.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_fp_setargscale() function sets the scale of the routine argument at position arg_pos in the MI_FPARAM structure that fparam_ptr references.

The scale is an attribute of the data type. The meaning of the scale depends on the associated data type, as the following list 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

The MI_FPARAM structure stores information about the scale of routine arguments in the zero-based argument-scale array. To set information for the nth argument, use an arg_pos value of n-1. For example, the following call to mi_fp_setargscale() sets the scale for the third argument of the my_func() UDR, with which fparam1 is associated:
mi_integer my_func(..., fparam1)
   ...
   MI_FPARAM *fparam1;
{
   ...
   mi_fp_setargscale(fparam1, 2, 4);

For more information about argument information in an MI_FPARAM structure or about the precision of a fixed-point data type, see the Informix® DataBlade® API Programmer's Guide.

Return values

None.