Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > OPEN >

Errors Associated with Select and Function Cursors

Because the database server is seeing the query for the first time, it might detect errors. In this case, it does not actually return the first row of data, but it resets the SQLCODE variable and the sqlca.sqlcode field of the sqlca. The value is either negative or zero, as the following table describes.

Code Value
Significance
Negative
An error was detected in the SELECT statement
Zero
The SELECT statement is valid

If the SELECT, SELECT...FOR UPDATE, EXECUTE FUNCTION (or EXECUTE PROCEDURE) statement is valid, but no rows match its criteria, the first FETCH statement returns a value of 100 (SQLNOTFOUND), meaning no rows were found.

Tip:
When you encounter an SQLCODE error, a corresponding SQLSTATE error value also exists. For information about how to view the message text, refer to the GET DIAGNOSTICS statement.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]