Access return-value information

The MI_FPARAM structure of a C user-defined function provides the following information about function return values:
  • Data type information about any return values
  • Boolean value to indicate whether a return value is NULL
Important: Because a user-defined function is written in the C language, it can only return a single value. However, this single value can be a structure (such as a row descriptor) that contains multiple values.
The following table lists the DataBlade® API accessor functions that obtain and set information about function return values in an MI_FPARAM structure. (Only user-defined functions return values; user-defined procedures do not.)
Table 1. Return-value information in the MI_FPARAM structure
Return-value information DataBlade API accessor function
The number of return values for the C UDR with which the MI_FPARAM structure is associated mi_fp_nrets() mi_fp_setnrets()
The type identifier of each return value that the MI_FPARAM structure contains mi_fp_rettype() mi_fp_setrettype()
The length of each return value that the MI_FPARAM structure contains mi_fp_retlen() mi_fp_setretlen()
The precision (total number of digits) of each return value that the MI_FPARAM structure contains mi_fp_retprec() mi_fp_setretprec()
The scale (number of digits to the right of the decimal point) of each fixed-point and floating-point return value that the MI_FPARAM structure contains mi_fp_retscale() mi_fp_setretscale()
Whether each return value that the MI_FPARAM structure contains is NULL mi_fp_returnisnull() mi_fp_setreturnisnull()