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.
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.