Technique
Problem
How to force SQL queries to use Passthru and how to verify this with a Db2 adapter.
Solution
To force SQL queries to use Passthru, use one of the two following ways:
- Use ENGINE DB2 as part of your query. For example:
ENGINE DB2
[native SQL or command]
;
END
- Specify the following command prior to your query or within a focexec: SET SQLENGINE= DB2
If you specify SET SQLENGINE=DB2 in your edasprof.prf file, it will force passthru to Db2 for all SQL queries. This may be problematic if you have applications that will be querying other adapters or datasources besides Db2.
To verify this with the Db2 adapter, use the SQLAGGR trace component to inspect aggregation and optimization messages. It may offer information about which operations were sent, and if not, why.