sqlcdbind() — Bind Your Error Code Address to ESQL
Binds the address of your local status variable, SQLCODE or SQLSTATE, to ESQL. This function supports the return of error and status codes from ESQL to your application after executing each SQL statement.
This function always returns 0 for a successful completion:
psqlcode
The address of your SQLCODE variable, declared to be a long C integer.
psqlstate
The address of your SQLSTATE variable.
NOTES
EXAMPLE
- The preprocessor generates a call to
sqlcdbind()
to bind the SQLCODE or SQLSTATE address to ESQL-LIB.- The SQL preprocessor does not check to ensure that SQLCODE or SQLSTATE is properly scoped according to C language conventions. You may declare SQLCODE or SQLSTATE external to all C functions or within a specific C function.
- Binding SQLCODE or SQLSTATE remains in effect only for the duration of the next ESQL-LIB function call that affects SQLCODE or SQLSTATE. Once that function returns, the binding is lost. To use the SQLCODE or SQLSTATE value for subsequent ESQL-LIB function calls, rebind SQLCODE or SQLSTATE before each call.
The preprocessor inserts both the call to
sqlcdbind()
and the test for SQLCODE < 0 as directed by a prior WHENEVER statement for each subsequent SQL statement:
SEE ALSO
"Programming with ESQL," for more information on SQLCODE, SQLSTATE, and the WHENEVER statement.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |