Created On:  11 October 2012

Problem:

The documentation for OpenESQL directives show a directive called ANSI92ENTRY but it doesn't really say what happens when this directive is used.  What behavior is changed by setting this directive?

Resolution:

A lot happens when you specify ANSI92ENTRY.

Here is our list:

Sets isolation level to serializable, default is read committed.

Closes non-HOLD cursors at end of transaction, default is to do what the driver does by default. Oracle and SQL Server leave them open.

Fetch on un-opened cursor give SQLSTATE 24000 rather than S1010, or 07005 rather than HY010 if ODBCV3 is set.
 
Fetch too many rows on a singleton select - when SQL(CHECKSINGLETON) is not set returns SQLCODE -1  and SQLSTATE 21000. CHECKSINGLETON returns SQLCODE -811 and SQLSTATE.
21000, otherwise if neither is set we return SQLCODE 1 and SQLSTATE 00000.

Fetch null with no indicator returns SQLCODE -19425, otherwise, for ESQLVERSION=20 we return -1 and for DIALECT=MAINFRAME we return -305 and if none of the above -1.

Open on an open cursor returns SQLCODE -19516 and SQLSTATE 07005 for ODBCV3 or 24000, otherwise we just close and re-open the cursor, which is what Oracle does.