Queries and Parameters
Each SQL statement invoked with IIapi_query() may or may not have query parameters associated with it. In general, query input parameters are needed when:
• An application specifies a dynamic parameter marker (?) in the query text
• A procedure ID, procedure name, procedure owner, or procedure parameters are required for the SQL statement
• A cursor ID or cursor name is required for the SQL statement
• A repeat query ID, repeat query parameters, or repeat query handle is required for a repeated statement
The table in this section lists the query types for SQL statements that can have query parameters associated with them. The first three columns provide information for sending an SQL statement to the DBMS Server. The Query Type column lists valid entries for the qy_queryType parameter of IIapi_query(). The Query Text? column indicates whether a query text entry is required in the qy_queryText parameter of IIapi_query(). Query text is not required for some SQL statements because OpenAPI can construct the query text based solely on the query type.
When SQL statements require query parameters, the application invokes IIapi_query() and then enters the parameters in subsequent calls to IIapi_setDescriptor() and IIapi_putParms(). The Query Input Parameters column indicates what parameters are needed.
Note: For a description of SQL statements and their parameters, see the SQL Reference Guide.
When an application calls IIapi_getQueryInfo(), it receives information about the status of a previously-invoked SQL statement. For some statements, IIapi_getQueryInfo() also returns available response data in the gq_mask parameter. This information is given for applicable SQL statements in the Result Parameters column of the table.
Last modified date: 08/28/2024