PreviousNext
Help > Development > Accessing AS/400 data > SQL > Prepared Queries > HPrepareSQLQuery
HPrepareSQLQuery

This function declares the query on the database server, to optimize data access.
The query is prepared, but not executed. No data is retrieved at this point.

This function optimizes data access in case of multiple execution of a query, with different parameters.

The query is then executed with function HExecuteQuery , after setting parameter values if needed.

 

To free resources used by the prepared query, use function HCancelDeclaration.

Warning: Some files on AS/400 can remain open. This is a normal behaviour. The AS/400 system optimizes open access paths.

 

 

Queries calling stored procedures, and returning multiple result sets are not supported.