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:

SYNTAX
int
sqlcdbind ( psqlcode, psqlstate)
  long  *psqlcode;  /* INPUT */
  char  *psqlstate;  /* INPUT */ 

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 inserts both the call to sqlcdbind() and the test for SQLCODE < 0 as directed by a prior WHENEVER statement for each subsequent SQL statement:

/* EXEC SQL WHENEVER SQLERROR GOTO err; */
            .
            .
            .
/* EXEC SQL close x; */
{
    sqlcdbind(&SQLCODE, (char *)0);
    sqldynclose(sql0, SQL_STMTDROP);
    if (SQLCODE < 0) goto err;
} 

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