Check for exceptions with sqlca
After an SQL statement executes, the sqlca structure
can indicate one of the four possible conditions that the following
table shows.
Exception condition | sqlca value |
---|---|
Success | SQLCODE (and sqlca.sqlcode) = 0 |
Success, but no rows found | SQLCODE (and sqlca.sqlcode) = 100 |
Success, but warnings generated | sqlca.sqlwarn.sqlwarn0 = 'W' To indicate
specific warning:
|
Failure, runtime error generated | SQLCODE (and sqlca.sqlcode) < 0 |
For a general introduction to these four conditions, see Types of database exceptions.