Note: SQL compiler directives for HCOSS are located under the
SQL Compiler Directive Options - HCOSS topic in the
HCO for SQL Server (HCOSS) section of this documentation.
ADOPICXISANSI
Instructs OpenESQL to pass string and character variables as ANSI.
ALLOWNULLCHAR
Allows programs to use PIC X(n) host variables, and to select/insert/update hexadecimal characters in CHAR columns without changing source to use SQL TYPE BINARY host variables.
ANSI92ENTRY
If this is set, OpenESQL conforms to the SQL ANSI'92 entry level standard.
AUTOCOMMIT
If this is set, each SQL statement is treated as a separate transaction and is committed immediately upon execution. If this is not set, and the ODBC driver you are using supports transactions, statements must be explicitly committed (or rolled back) as part of a transaction.
AUTOFETCH
Sets the AUTOFETCH attribute on SELECT statements that are run on Microsoft SQL Server data sources. Compiling with this directive can help the performance of your application. This directive works only if the program is also compiled with directive SQL(TARGETDB=MSSQLSERVER). It also serves as a primitive directive for the BEHAVIOR directive option.
BEHAVIOR Instructs OpenESQL to properly match your COBOL cursors with the database you specify, thus maximizing database cursor performance. BEHAVIOR makes use of multiple primitive directives and associates a default value for each primitive directive depending on the DBMS you are using. You can also override the default setting of any primitive directive.
CHECK
Sends each SQL statement to the database at compilation time.
CHECKDUPCURSOR
Instructs OpenESQL to determine if the cursor has been opened twice, and if so takes action accordingly.
CHECKSINGLETON
Instructs OpenESQL to check if singleton SELECTs return more than one row when executed. If this is the case, OpenESQL returns SQLCODE -811.
CONCAT
Specifies the ASCII character code to use for the CONCAT symbol (|). Use this directive only if you need to change the default.
CONNECTIONPOOL
Enables use of ODBC 3.0 connection pooling. When a connection is closed, the Driver Manager actually keeps it alive for a timeout period, and saves the overhead of re-establishing a connection from scratch if the application re-opens an identical connection. ODBC allows you to choose between having a pooling for an ODBC environment or for each driver. See your ODBC documentation for details.
CTRACE
Causes debug information to be put into the file sqltrace.txt.
CURSORCASE
If ESQLVERSION is 2.0, CURSORCASE is implied. NOCURSORCASE means that cursor names are not case sensitive. CURSORCASE means that they are case sensitive. Note that in previous versions of OpenESQL, cursor names have been case sensitive.
DATE
Controls the reformatting of date values in output parameters and in input parameter character host variables when DETECTDATE is also specified.
DATEDELIM
Specifies a single character as the delimiter between the year, month, and day components to override the default delimiter determined by the HCOSS DIALECT or DATE directive specification.
DB
The name of the data source to connect to. This option works in conjunction with the INIT and/or CHECK options. The .int file generated is the same except for the TARGETDB number embedded in the file.
DBMAN
Specifies the preprocessor to use. This directive is not required when compiling programs with OpenESQL.
DECDEL
Eliminates the need for OpenESQL to call the routine GetLocaleInfo for any variable that would store decimal data. This routine is called every time the variable is accessed to return the decimal delimiter used. In most cases, this is a period or comma. The options for this directive are:
DETECTDATE
Enables recognition of date, time and datetime values in character host variables.
FIPSFLAG
Enables FIPS flagging (NIST certification requirement only).
GEN-INIT-FLAG
Generates the SQL-INIT-FLAG variable for DB2 for OS/390 compatibility. The flag is updated when the SQL environment is initialized. If you define this variable in your application, compile your application with this directive set to NOGEN-INIT-FLAG and the variable will not be generated by the precompiler.
HSFTRACE
Generates calls around each SQL statement to the HSF trace routine if the application is running under Enterprise Server. In some cases, the application must be linked with mfsqlSMF.lib.
IGNORE-NESTED
In nested programs, this is the program-id at which to start generating the database interface code. If the program file name matches the program-id, you can just specify IGNORE-NESTED.
INIT
If this is set, the preprocessor automatically generates code to make the connection to the database. If you specify INIT, you must also specify DB and PASS. We highly recommend that you use EXEC SQL CONNECT statements in your application instead.
ISOLATION
This directive specifies the isolation level that OpenESQL uses as a connection attribute. It also serves as a primitive directive for the BEHAVIOR directive option.
JIT
Generate OpenESQL interface code only if an EXEC SQL statement is found in the procedure division.
MARS
Enable multiple active results sets when connecting to an Microsoft SQL Server 2005 or later. To use this directive, you must also specify TARGETDB=MSSQLSERVER.
NIST
Sets OpenESQL to conform to the NIST interpretation of the SQL ANSI 92 entry level standard.
NOT
Specifies the character code to use for NOT symbol (¬). Use this only if you need to change the default setting.
ODBCTRACE
ODBCTRACE=USER enables you to control ODBC tracing via the ODBC control panel from which you can specify the file that the trace goes into.
ODBCV3
This directive causes an application to register itself as an ODBC Version 3 application. If ODBCV3 is not specified, the application registers itself as an ODBC Version 2 application. There can be a small performance benefit in registering as an ODBC 3 application. However, registering as an ODBC Version 3 application can result in error and warning conditions returning different values for SQLCODE and SQLSTATE. We recommend that you use this directive with care.
PARAMARRAY
If PARAMARRAY is set, ODBC array binding is used, if it is supported by the ODBC driver, for all input parameters.
PASS
The login to use to connect to the data source. This option works in conjunction with the INIT and/or CHECK options.
PRE
PRE causes the preprocessor to generate code to load the OpenESQL runtime module (odbcrw32.dll) dynamically at runtime. This conflicts with the LITLINK compiler directive. So if you use LITLINK, specify NOPRE to stop the dynamic loading code being generated. In this case, you must add odbcrw32.lib to the list of LIBs to be linked in your build settings. Then the linker generates code into the executable which causes the operating system to load odbcrw32.dll implicitly when the executable is loaded.
PREFETCH
An application can use this directive to request that OpenESQL use block fetches for cursors. This can provide performance benefits, similar to array fetching, without having to change program logic. The performance benefit depends on the value of n and on whether the ODBC driver in use is already configured to use prefetching.
QUALFIX
Causes the OpenESQL preprocessor to append three characters to the name of the host variables when declaring them to SQL. This ensures problems caused by qualification (where two or more host variables have identical names when not qualified) are avoided but has the side-effect that SQL error messages sometimes display the names of host variables with the three additional characters appended to them.
RESULTARRAY
If RESULTARRAY is set, ODBC array binding is used, if it is supported by the ODBC driver, for all output parameters.
STMTCACHE
The number of prepared SQL statements OpenESQL can cache such that the statements never again require preparation during a program run, thus improving performance.
TARGETDB
Set this directive if you want to optimize performance for a specific data source.
TESTSQLSTATE
Instructs OpenESQL to generate code that tests SQLSTATE rather than SQLCODE after an SQL statement is executed.
THREAD
If THREAD is set to ISOLATE, all connections, cursors and so on are local to the thread that creates them. This is required for multi-threaded application server environments such as IIS/ISAPI. With THREAD=SHARE, if you have a hard-coded CONNECT statement and thread 1 executes it and then thread 2 executes it, thread 2 gets an error because the connection is already open. With THREAD=ISOLATE, each thread gets its own connection.
TIME
Controls the reformatting of date values in output parameters and in input parameter character host variables when DETECTDATE is also used.
TIMEDELIM
Specifies a single character as the delimiter between the hour, minute, and second components to override the default delimiter determined by the HCOSS DIALECT or TIME directive specification.
TRACELEVEL
Produces a statistical analysis of application behavior by tracing certain operations in native applications. The report produced by this directive provides better readability and is inherently more useful than a traditional ODBC trace.
TSTAMPSEP
Specifies a single character as the separator between the date and time parts of timestamp and date/time data.
USECURLIB
Controls use of the ODBC's Cursor Library. The Cursor Library can provide support for scrolling cursors when the underlying driver doesn't, and can also allow "simulated" positioned updates. With USECURLIB=YES, the Cursor Library will always be used. With USERCURLIB=NO, it will never be used. With the default USERCURLIB=IFNEEDED, it will be used if the application tries to do something the driver manager thinks the driver doesn't support. To use a scrolling cursor with the Cursor Library, you must use a STATIC cursor. To do positioned updates using the Cursor Library, you must use OPTCCVAL concurrency.