OpenAPI User Guide > OpenAPI User Guide > OpenAPI Function Reference > OpenAPI Functions > IIapi_putParms() Function--Send Query Statement Parameter Values to a Server
Was this helpful?
IIapi_putParms() Function--Send Query Statement Parameter Values to a Server
The IIapi_putParms() function allows the application to send parameter data to a server at statement execution time.
This function is preceded with the IIapi_setDescriptor() function, which describes the format and number of parameters to be sent to the server.
IIapi_putParms() processes parameters sequentially in the order they appear in the query. The application sends all parameters with a single call to IIapi_putParms(), provided the parameters do not contain any long varchar or long byte data types. The total number of parameters provided for a query must not be less than the number of parameters the query expects.
If one of the parameters is a long varchar or long byte that requires more than one segment to be sent, the application sends the parameters individually with single calls to IIapi_putParms(). For example, a row of ten parameters with a long varchar or long byte spanning multiple segments as the fifth parameter is handled as follows. The application:
1. Sends four parameters with a call to IIapi_putParms().
2. Sends one segment of the long varchar or long byte parameter with a call to IIapi_putParms().
3. Continues sending individual segments until all are sent.
4. Sends five parameters with a call to IIapi_putParms() to send the rest of the parameters in the current row.
This function has the following syntax:
II_VOID IIapi_putParms (IIAPI_PUTPARMPARM *putParmParm);
typedef struct _IIAPI_PUTPARMPARM
{
       IIAPI_GENPARM       pp_genParm;
       II_PTR              pp_stmtHandle;
       II_LONG             pp_parmCount;
       IIAPI_DATAVALUE     *pp_parmData;
       II_BOOL             pp_moreSegments;
} IIAPI_PUTPARMPARM;
This function has the following parameters:
pp_genParm
Type: input and delayed output
Specifies the generic parameters. For a description, see Generic Parameters).
pp_stmtHandle
Type: input
Specifies the statement handle identifying the query.
pp_parmCount
Type: input
Specifies the number of parameters associated with the query.
pp_parmData
Type: input
Specifies an array of buffers containing parameter data to be sent to the server. The number of buffers in this array must be equal to the value of pc_parmCount.
pp_moreSegments
Type: input
Indicates whether there is more data to be sent for the current parameter of a long varchar or long byte data type. This parameter is set to TRUE if the data type is long varchar or long byte and more data must be sent for the current parameter; otherwise, it is set to FALSE.
Last modified date: 08/28/2024