SQL execution diagnostics
If an SQL statement execution failed, error description can be found in the SQLCA.SQLCODE, SQLSTATE, STATUS and SQLERRMESSAGE predefined registers.
The SQLCA diagnostic record
The SQLCA variable is a predefined record containing SQL statement execution information.
SQL interruption
Interrupt long running SQL queries, or interrupt waiting queries because data is locked.
Debugging SQL
Set the FGLSQLDEBUG environment variable to print SQL debug info.
Cursors and connections
Several database connections can be opened simultaneously with the CONNECT TO instruction. Once connected, you can DECLARE cursors or PREPARE statements to be used in parallel within different connection contexts. This section describes how to use SQL cursors and SQL statements in a multiple-connection program.
Implicit database connection
An implicit database connection is made with the DATABASE instruction used before MAIN; use SCHEMA to avoid the implicit connection.