Primitive directives further qualify the behavior set by the BEHAVIOR directive.
OpenESQL uses the database type you specify by setting the TARGETDB directive. When you set the TARGETDB directive, it enables you to override the default value of any primitive directive by specifying it as an argument to the BEHAVIOR directive.
If you do not set the TARGETDB SQL compiler directive option, OpenESQL determines the target database type based on the SQL CONNECT TO statement in your source code. In this case, OpenESQL uses the default settings for all primitive directives. You cannot override them.
Default values for primitive directives vary based on the value of the BEHAVIOR directive, and the database target. Defaults for the MS SQL Server database target are different than those for all other database targets. The following tables show default values for BEHAVIOR settings and database target combinations:
Primitive Directive | BEHAVIOR=UNOPTIMIZED1 | BEHAVIOR=MAINFRAME (CICS or JCL) | BEHAVIOR=ANSI |
---|---|---|---|
AUTOFETCH | NOAUTOFETCH | AUTOFETCH | AUTOFETCH |
DEF_CURSOR | UPD | RO | UPD |
IC_FH_ISOLATION | N/A | UR | UR |
ISOLATION | CR | CR | CR |
PF_RO_CURSOR | 1 | 1 | 1 |
PF_UPD_CURSOR | 1 | 8 | 8 |
RO_CURSOR | DYNAMIC | IC_FH 2 | IC_FH 2 |
TRANSACTION | LOCAL | GLOBAL for CICS, otherwise LOCAL | LOCAL |
UPD_CONCURRENCY | LOCK | LOCK | LOCK |
UPD_CURSOR | DYNAMIC | DYNAMIC | DYNAMIC |
1 Default setting in previous releases.
2 If both the server and the client support MARS, MARS is enabled using a FORWARD cursor. |
Primitive Directive | BEHAVIOR=UNOPTIMIZED1 | BEHAVIOR=MAINFRAME (CICS or JCL) | BEHAVIOR=ANSI |
---|---|---|---|
AUTOFETCH | N/A | N/A | N/A |
DEF_CURSOR | UPD | RO | UPD |
IC_FH_ISOLATION | N/A | N/A | N/A |
ISOLATION | CR | CR | CR |
PF_RO_CURSOR | 1 | 8 | 8 |
PF_UPD_CURSOR | 1 | 8 | 8 |
RO_CURSOR | DYNAMIC | FORWARD | FORWARD |
TRANSACTION | LOCAL | GLOBAL for CICS, otherwise LOCAL | LOCAL |
UPD_CONCURRENCY | LOCK | LOCK | LOCK |
UPD_CURSOR | DYNAMIC | KEYSET | KEYSET |
If you set your target database type using the TARGETDB directive, you can override the default settings by specifying a primitive directive as an argument to the BEHAVIOR directive. The following topics explain the full use of each primitive directive: