TARGETDB

Set this directive if you want to optimize performance for a specific data source.

Syntax:

TARGETDB={MSSQLSERVER | ORACLE | INFORMIX | 
          SYBASE | DB2 | ORACLE7 | POSTGRESQL}
NOTARGETDB

Properties:

Default: NOTARGETDB

Scope:

Used at compile time: No
Behavior at run time: Process

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

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.