Progress
Embedded SQL-92
Guide and Reference
The SQLCA Structure
The complete SQLCA structure is in the
sql_lib.h
file, in the include directory of your installation. This is an excerpt from the SQLCA structure:
Descriptions of the fields in the SQLCA structure follow:
SQLCAID
Contains the string 'SQLCA'.
SQLCABC
Contains the size of the SQLCA structure.
SQLCODE
Gives the result of an SQL statement execution. The SQLCODE can have the following values:
- Zero: Indicates successful execution.
- Positive: Indicates successful execution with a status code. The database returns the positive status code SQL_NOT_FOUND when there are no more rows to be fetched. The SQL_NOT_FOUND status is defined in sql_lib.h.
- Negative: Indicates an error in execution of the SQL statement or a system failure.
SQLERRML
Contains the length of the error message in SQLERRM.
SQLERRM
Is a NULL terminated character string that is the error text corresponding to the code returned in the component SQLCODE.
SQLERRP
Currently not used.
SQLERRD
Is an array of six elements where each element is a long integer.
SQLERRD[2]
Indicates the number of rows processed after a successful execution of INSERT UPDATE and DELETE statements. SQLERRD[2] is set to the cumulative number of rows for a FETCH call associated with a cursor.
SQLERRD[3]
Is set to the number of rows fetched by the last FETCH call.
SQLWARN
A character array of size eight where each character value can either be a blank or a 'W'. A character 'W' in any of the character positions of the array indicates a warning during the execution of an SQL statement. Currently, only elements 0, 1, 2, 3, 4, and 6 of the array are used.
SQLWARN[0]
Set to 'W', then one or more of the other SQLWARN components have been set. If this component is blank no warning has been set.
SQLWARN[1]
Set to 'W' to indicate that one or more of the strings returned by the previous FETCH call have been truncated. Use the indicator variables to determine which of the strings were truncated.
SQLWARN[2]
Set to 'W' when one or more NULL values were ignored in the computation of an aggregate function.
SQLWARN[3]
Set to 'W' to indicate that the number of items in the SELECT list does not equal the number of host variables in the INTO clause; the query returns all the elements it can, which is the lesser of the two counts.
SQLWARN[4]
Set to 'W' after a successful execution of an UPDATE or a DELETE statement without a WHERE clause; it is more useful to check for this component while working with dynamic statements.
SQLWARN[6]
Set to 'W' if the transaction is implicitly marked for ROLLBACK. The application must roll back the current transaction before executing the next SQL statement.
SQLEXT
Currently not used.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |