Tells the SQL preprocessor to use an SQLCA other than the default global sqlca.
SET SQLCA sqlca
an_sql_code FAR PASCAL ExecuteSQL( an_application *app, char *com ) { EXEC SQL BEGIN DECLARE SECTION; char *sqlcommand; EXEC SQL END DECLARE SECTION; EXEC SQL SET SQLCA "&app->.sqlca"; sqlcommand = com; EXEC SQL WHENEVER SQLERROR CONTINUE; EXEC SQL EXECUTE IMMEDIATE :sqlcommand; return( SQLCODE ); }
The current SQLCA pointer is implicitly passed to the database interface library on every Embedded SQL statement. All Embedded SQL statements that follow this statement in the C source file use the new SQLCA. This statement is necessary only when you are writing code that is reentrant. The sqlca should reference a local variable. Any global or module static variable is subject to being modified by another thread.