TARGETDB={MSSQLSERVER | ORACLE | INFORMIX | SYBASE | DB2 | ORACLE7 | POSTGRESQL | PGSQL | PGSQLAWS} NOTARGETDB
Use the MSSQLSERVER, ORACLE, INFORMIX, SYBASE, DB2, or ORACLE7 parameters to compile code for their respective databases. Choose from the following parameters to compile for PostgreSQL:
Default: | NOTARGETDB |
Used at compile time: | No |
Behavior at run time: | Process |
See Scope - OpenESQL SQL Compiler Directive Options for more information.
When TARGETDB=DB2, OpenESQL retains the generated FOR READ ONLY clause to assist DB2 in generating a more efficient access plan.
With the vast majority of non-DB2 databases, the FOR READ ONLY clause has no effect on the access plan that the database server generates for a query. This, in combination with the fact that FOR READ ONLY syntax is not supported by most servers, OpenESQL removes the generated FOR READ ONLY clause at compile time unless TARGETDB is set to DB2. Removing this clause can facilitate code migration between different database servers, and can also facilitate the incorporation of code that works with multiple types of database servers.