Warnings in sqlca.sqlwarn
When the database server executes an SQL statement successfully,
but encounters a warning condition, it updates the following two fields
in the sqlca.sqlwarn structure:
- It sets the sqlca.sqlwarn.sqlwarn0 field to the letter
W
. - It sets one other field within the sqlwarn structure (sqlwarn1 to sqlwarn7)
to the letter
W
to indicate the specific warning condition.
These warnings are specific to HCL Informix®. Fields of the sqlca structure contains two sets of warning conditions that can occur in the fields of the sqlca.sqlwarn structure. The first set of warnings, shown in Fields of the sqlca structure, occurs after the database server opens a database or establishes a connection. For more information about these conditions, see Determine features of the database server. The second set of warnings is for conditions that can occur as a result of other SQL statements.
To test for warnings, check whether the first warning
field (sqlwarn0) is set to
W
. After you determine
that the database server has generated a warning, you can check the
values of the other fields in sqlca.sqlwarn to identify the
specific condition. For example, if you want to find out what database
a CONNECT statement has opened, you can use the code that the following
figure shows.