The mi_fp_setargprec() function

The mi_fp_setargprec() accessor function sets the precision of a fixed-point or floating-point argument of a user-defined routine in its associated MI_FPARAM structure.

Syntax

void mi_fp_setargprec(fparam_ptr, arg_pos, arg_prec)
   MI_FPARAM *fparam_ptr;
   mi_integer arg_pos;
   mi_integer arg_prec;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
arg_pos
The index position into the argument-precision array for the argument whose precision you want to set.
arg_prec
The integer precision, 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_setargprec() function sets the precision of the routine argument at position arg_pos in the MI_FPARAM structure that fparam_ptr references.

The precision is an attribute of the data type that represents the total number of digits the routine return value can hold, as follows.
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
The MI_FPARAM structure stores information about the precision of routine arguments in the zero-based argument-precision array. To set information for the nth argument, use an arg_pos value of n-1. For example, the following call to mi_fp_setargprec() sets the precision for the third argument of the my_func() UDR, with which fparam1 is associated:
mi_integer my_func(..., fparam1)
   ...
   MI_FPARAM *fparam1;
{
   ...
   mi_fp_setargprec(fparam1, 2, 10);

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

Return values

None.