SQLCODE variable

When an SQL is executed, HiRDB sets a return code (SQLCODE). The value returned to the SQLCODE variable is the same as the contents of SQLCODE in the SQL Communications Area.

Because the system includes the necessary declaration statement in the source program during preprocessing, the SQLCODE variable does not need to be declared in the UAP. In C language, the data type of the SQLCODE variable is declared as a signed long int; in COBOL, it is declared as S9(9) COMPUTATIONAL.

To reference the SQLCODE variable, the variable name SQLCODE must be specified.

In an environment the uses the multi-connection facility, the connection handle used by SQLCODE must be declared with DECLARE CONNECTION HANDLE SET.