The third element of SQLERRD in the SQLCA, SQLERRD(3), records the number of rows processed for INSERT, UPDATE, DELETE and SELECT INTO statements. For FETCH statements, it records the cumulative sum of rows processed.
SQLERRD(3)
For DB2, SQLERRD(3) contains the following:
- If PREPARE is invoked and successful, an estimate of the number of rows that will be returned.
- After INSERT, UPDATE and DELETE, the actual number of rows affected.
- If compound SQL is invoked, a count of the number of successful substatements.
- If CONNECT is invoked, either 1 if the database can be updated or 2 if the database is read-only.
- If an error occurs when processing a host array, the last row that was processed successfully.
SQLERRD(4)
For DB2, SQLERRD(4) contains the following:
- If PREPARE is invoked and successful, a relative cost estimate of the resources required to process the statement.
- If compound SQL is invoked, a count of the number of successful substatements.
- If CONNECT is invoked, 0 for a one-phase commit from a down-level client; 1 for a one-phase commit; 2 for a one-phase, read-only commit; 3 for a two-phase commit.
SQLERRD(5)
For DB2, SQLERRD(5) contains the following:
- The total number of rows deleted, inserted, or updated as a result of both:
- The enforcement of constraints after a successful delete operation.
- The processing of triggered SQL statements from activated triggers.
- If compound SQL is invoked, an accumulation of the number of such rows for all substatements. In some cases, when an error is encountered, this field contains a negative value that is an internal error pointer.
- If CONNECT is invoked, an authentication type value of 0 for a server authentication; 1 for client authentication; 2 for authentication using DB2 Connect; 3 for DCE security services authentication; 255 for unspecified authentication.