Previous Topic Next topic Print topic


Primitive Directives

Primitive directives further qualify the behavior set by the BEHAVIOR directive.

For OpenESQL to use primitive directives, it must be able to determine your target database type. This is done one of two ways:
  • TARGETDB compiler directive option

    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.

  • SQL CONNECT TO statement

    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.

Note: In addition to their role as OpenESQL SQL compiler directive options, AUTOFETCH and ISOLATION also serve as primitive directives to the BEHAVIOR compiler directive option.

Primitive Directive Defaults

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 Defaults for SQL Server Database Targets
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 Defaults for Database Targets Other than SQL Server
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:

Previous Topic Next topic Print topic