Top
NetCOBOL V11.0.0 Release Notes
FUJITSU Software

2.1.5 Location of SQLCODE/SQLMSG/SQLERRD definition

SQLCODE, SQLMSG, and SQLERRD can now be defined outside of the SQL declaration section. Under the conditions listed below, SQL statement runtime information was not stored in V10.1.0. In V10.2.0 and later, runtime information is stored in SQLCODE, SQLERRD, and SQLMSG.

  1. SQLSTATE is described inside the SQL declaration section, and

  2. SQLCODE, SQLERRD, or SQLMSG are described outside the SQL declaration section, and

  3. SQL statements are executed, and

  4. SQLCODE, SQLERRD, or SQLMSG are referred to in the PROCEDURE DIVISION, and

  5. Conditions 1 through 4 are occurred in the same compilation unit.

In V10.2.0 and later, SQLCODE, SQLERRD, and SQLMSG are reserved names used to fetch SQL statement runtime information. If you have variables by those names that are used for any other purpose, the results are unpredictable. In this case, change the names of those variables.