Progress
Embedded SQL-92
Guide and Reference
Using an SQLCA to Check for Warnings
You can use an SQLCA to check for warnings that occur during the execution of an SQL statement. The component SQLWARN of SQLCA is an array of eight characters. Each element of the array can be either a blank or a `W'.
Currently Progress uses the elements 0, 1, 2, 3, 4, and 6 of the SQLWARN array. These are the conditions under which warning flags are set:
EXAMPLE
- One or more string values returned by a query are truncated
- One or more NULL values are ignored in the computation of an aggregate function
- The number of items in the SELECT list does not equal the number of host variables in the INTO clause
- The database implicitly marks the transaction for ROLLBACK
The following example computes the average commission for employees in the sales department, and shows how to evaluate the SQLWARN array to check for null values in the data:
This example evaluates the SQLWARN[2] component of the SQLCA to determine if any NULL values were ignored in the computation of the average commission.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |