 |
INFORMIX-ESQL/C Programmer's Manual Exception Handling
|
|
Obtaining Diagnostic Information After an SQL Statement
After your ESQL/C program executes an SQL statement, the database server returns information about the success of the statement. This section summarizes the following information:
Types of Diagnostic Information
The database server can return the following types of diagnostic information:
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:
- Error
- The SQL statement did not execute successfully and made no change to 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.
Descriptive Information
The following SQL statements can return information about SQL statements:
The Informix Guide to SQL: Syntax fully describes these two statements.
Types of Status Variables
The following methods obtain diagnostic information about the outcome of an SQL statement:
When you create applications that must conform to either the ANSI or X/Open standard, use the SQLSTATE variable as your primary exception-handling method.
INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved