Progress
Embedded SQL-92
Guide and Reference


SQL Communications Area (SQLCA)

The SQL engine returns a status code after it processes an SQL executable statement. The status code is returned in the SQL Communications Area (SQLCA). This structure contains information about the status of the execution of the most recently executed SQL statement. The SQLCA provides additional information about the executed statement. The SQLCA includes the following information:

The SQLCA is a mechanism that allows the application developer to take appropriate program steps, depending on feedback about attempted SQL operations. Your application should examine the SQLCA to determine whether an SQL statement executed successfully. The SQLCA also returns a row count after each INSERT, UPDATE, or DELETE operation.

Two frequently used SQLCA components are:

SQLCODE

This component holds a status code after the execution of every executable SQL statement. The SQLCODE field is of data type LONG, and its value indicates the success or failure of the statement execution. A zero value returned in SQLCODE indicates successful execution. A negative SQLCODE indicates an error in execution. A positive SQLCODE indicates a successful execution with a status code. Currently, the only positive status code is SQL_NOT_FOUND, which is returned when there are no more rows found in a fetch operation.

SQLWARN

This component is a CHAR array of size 8, where each array element is set to the warning flag (W) or a blank. SQLWARN[ 0 ] is set to W if any of the other flags are set, indicating that a warning level condition occurred during execution.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095