Was this helpful?
Parameter Blocks
The parameter block is a C structure that is used for passing information back and forth between an application and OpenAPI. All OpenAPI functions require a parameter block.
The application creates the parameter block and passes it as an argument to the OpenAPI function.
Each parameter block contains input and output parameters:
Input parameters
Contain information sent by the application and needed by OpenAPI to carry out the request.
Output parameters
Are returned from OpenAPI to the application and contain the results needed by the application for status reporting or for making subsequent function calls. Output parameters can be immediate output or delayed output:
Immediate output parameters
Contain meaningful values as soon as the OpenAPI function returns.
Delayed output parameters
Contain no meaningful values until all tasks associated with the OpenAPI function are completed.
Most parameter blocks have a common substructure containing generic parameters. The generic parameters are used to handle asynchronous processing and to communicate the return status of the function.
Example—parameter block
The following parameter block is allocated before the OpenAPI function IIapi_query() is invoked:
typedef struct _IIAPI_QUERYPARM
{
Generic Parameters (containing input and output parameters):
IIAPI_GENPARM qy_genParm;
Input Parameters:
II_PTR qy_connHandle;
IIAPI_QUERYTYPE qy_queryType;
II_CHAR *qy_queryText;
II_BOOL qy_parameters;
Input and Immediate Output Parameters:
II_PTR qy_tranHandle;
Immediate Output Parameters:
II_PTR qy_stmtHandle;
} IIAPI_QUERYPARM;
The resources associated with the parameter block must not be freed until the OpenAPI function completes.
More information:
Last modified date: 08/14/2024