INFORMIX
DataBlade API Programmer's Manual
Chapter 4: Using the MI_FPARAM Structure
Home Contents Index Master Index New Book

Checking Arguments and Return Values

Among the state information that the MI_FPARAM structure holds about an iterator function is information about the arguments and return values of the function, in particular, whether they have null values and what data types they are.

You can use DataBlade API functions to obtain this information about arguments and return values.

Checking Arguments

The following DataBlade API functions access information about the arguments of a routine that the MI_FPARAM structure describes:

    This array contains an element for each argument of the routine. Because it is a zero-based array, it has (fp_nargs-1) elements. Each element is either MI_FALSE (the argument is not null) or MI_TRUE (the argument is null). A null argument means that no value has been passed in for the associated parameter of the routine.

    This array also contains an element for each argument of the routine. Because it is a zero-based array, it has (fp_nargs-1) elements. Each element is the integer data-type constant that indicates the data type of the argument. The sqltypes.h header file contains defined constants for each of these data-type values.

Checking Return Values

A DataBlade API function can only return a single value because it is written in the C language. The following DataBlade API functions access information about the return value of a function that the MI_FPARAM structure describes:

    For DataBlade functions that are written in C, the fp_nrets value is always 1.

    This array contains an element for each return value of the function. Because fp_returnisnull is a zero-based array, it has (fp_nrets-1) elements. Each element is either MI_FALSE (the return value is not null) or MI_TRUE (the return value is null). For DataBlade functions written in C, only the fp_returnisnull[0] element has a valid value.

    This array also contains an element for each argument of the routine. Because fp_rettype is a zero-based array, it has (fp_nrets-1) elements. Each element is the integer data-type constant that indicates the data type of the argument. The sqltypes.h header file contains defined constants for each of these data-type values. For DataBlade functions written in C, only the fp_rettype[0] element has a valid value.




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.