Types of database exceptions

When the database server executes an SQL statement, it can return one of four types of database exceptions to the application program:
  • Success

    The SQL statement executed successfully. When a statement that might return data into host variables executes, a success condition means that the statement has returned the data and that the program can access it through the host variables.

  • Success, but warning generated

    A warning is a condition that does not prevent successful execution of an SQL statement; however, the effect of the statement is limited and the statement might not produce the expected results. A warning can also provide additional information about the executed statement.

  • Success, but no rows found
    The SQL statement executed without errors, with the following exceptions:
    • No rows matched the search criteria (the NOT FOUND condition).
    • The statement did not operate on a row (the END OF DATA condition).
  • Error
    The SQL statement did not execute successfully and did not change the database. Runtime errors can occur at the following levels:
    • Hardware errors include controller failure, bad sector on disk, and so on.
    • Kernel errors include file-table overflow, insufficient semaphores, and so on.
    • Access-method errors include duplicated index keys, SQL null inserted into non-null columns, and so on.
    • Parser errors include invalid syntax, unknown objects, invalid statements, and so on.
    • Application errors include user or lock-table overflow, and so on.