SQLWARN array
The eight character fields in the SQLWARN array are set to either a blank or to W to indicate a variety of special conditions. Their meanings depend on the statement just executed.
A set of warning flags appears when a database opens, that is, following a CONNECT, DATABASE, or CREATE DATABASE statement. These flags tell you some characteristics of the database as a whole.
A second set of flags appears following any other statement. These flags reflect unusual events that occur during the statement, which are usually not serious enough to be reflected by SQLCODE.
Both sets of SQLWARN values are summarized in
the following table.
Field | When opening or connecting to a database | All other SQL operations |
---|---|---|
First | Set to W when any other warning field is set to W. If blank, others need not be checked. | Set to W when any other warning field is set to W. |
Second | Set to W when the database now open uses a transaction log. | Set to W if a column value is truncated when it is fetched into a host variable using a FETCH or a SELECT...INTO statement. On a REVOKE ALL statement, set to W when not all seven table-level privileges are revoked. |
Third | Set to W when the database now open is ANSI compliant. | Set to W when a FETCH or SELECT statement returns an aggregate function (SUM, AVG, MIN, MAX) value that is NULL. |
Fourth | Set to W when the database server is HCL Informix®. | On a SELECT ... INTO, FETCH ... INTO, or EXECUTE ... INTO statement, set to W when the number of projection list items is not the same as the number of host variables given in the INTO clause to receive them. On a GRANT ALL statement, set to W when not all seven table-level access privileges are granted. |
Fifth | Set to W when the database server stores the FLOAT data type in DECIMAL form (done when the host system lacks support for FLOAT types). | Set to W after a DESCRIBE statement if the prepared object contains a DELETE statement or an UPDATE statement without a WHERE clause. |
Sixth | Reserved. | Set to W following execution of a statement that does not use ANSI-standard SQL syntax (provided the DBANSIWARN environment variable is set). |
Seventh | Set to W when the application is connected to a database server that is the secondary server in a data-replication pair. That is, the server is available only for read operations. | Set to W when a data fragment (a dbspace) has been skipped during query processing (when the DATASKIP feature is on). |
Eighth | Set to W when client DB_LOCALE does not match the database locale. For more information, see the HCL Informix GLS User's Guide. | Set to W when SET EXPLAIN ON AVOID_EXECUTE statement prevents query execution. |