You can use pureQuery client optimization with CLI applications
that connect to either an Informix® or a DB2® database
as a data server.
Only DB2 databases
support executing SQL statements statically. However, when using a
CLI application that is enabled with pureQuery client optimization
with an IDS data server, you can enable pureQuery features including
the following:
- Execute alternate SQL statements
- Using the enableDynamicSQLReplacement keyword,
you can tune the SQL statements by providing an alternate SQL statement
in pureQueryXML file. So that during application runtime, this optimized
statement is passed to the Informix
database server.
- Store and retrieve pureQueryXML data in a repository
- You can store the contents of a pureQueryXML file in a repository
and specify the pureQueryXML file data when you run a CLI application
that is enabled with pureQuery client optimization. Specify the location
of the pureQueryXML file data with the pureQueryXmlRepository and propertiesGroupId keywords.
You
create and manage a repository with the pureQuery ManageRepository
utility. For information about the database requirements for creating
a repository, see the pureQuery system requirements.
- SQL statement literal substitution
- pureQuery client optimization supports SQL statement literal substitution
when you set the sqlLiteralSubstitution keyword to ENABLE.
pureQuery Runtime can replace literal data in SQL statements with
parameter markers. When capturing SQL statements in a pureQueryXML
file, this capability helps control the size of the pureQueryXML file.
SQL statement literal substitution also provides better problem determination.
Similar SQL statements can be grouped into single SQL statement in
pureQueryXML file.
This capability supports running SQL statements
statically in a parameterized form that you might not be able to run
statically otherwise. For example, if an application runs SQL queries
that differ only by literal values, SQL literal substitution supports
running the parameterized version of the statement statically. You
do not have to create and bind packages containing the SQL queries
with every possible combination of literals.
You can set the sqlLiteralSubstitution keyword
to ENABLE without specifying any other pureQuery
keyword. pureQuery Runtime replaces literal values in SQL statement
with parameter markers before running the statement.
- Run only captured SQL statements
- CLI applications that are enabled with pureQuery client optimization
support the captureOnly= TRUE keyword with an IDS
data source. This capability helps to prevent SQL injection by limiting
the SQL statements executed dynamically by the application to the
SQL statements listed in pureQueryXML file.
Note: The staticBinder utility cannot be run
against an IDS database. Also, the executionMode=STATIC keyword
is not supported for a CLI application connected to an IDS database.
If
you specify a pureQuery Runtime keyword that is not supported with
an IDS data server, it is ignored.