TARGETDB

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

Syntax:

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

Parameters

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:

POSTGRESQL or PGSQLAWS
Compile for AWS PostgreSQL environments.
PGSQL
Compile for community PostgreSQL GDG community environments.
Note: Support for PostgreSQL GDG community edition is in Early Adopter Release status.
Attention: When using HCOPG, the TARGETDB directive is mandatory as well as DIALECT=MAINFRAME.

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.