SET SQLCA statement [ESQL]
616
SET SQLCA statement [ESQL]
Use this statement to tell the SQL preprocessor to use a SQLCA other than
the default, global sqlca.
SET SQLCA
sqlca
sqlca
:
identifier
or
string
None.
None.
"SQLCA management for multi-threaded or reentrant code" on page 29 of
the book ASA Programming Interfaces Guide
The SET SQLCA statement tells the SQL preprocessor to use a SQLCA
other than the default global sqlca. The sqlca must be an identifier or string
that is a C language reference to a SQLCA pointer.
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 will use the new SQLCA.
This statement is necessary only when you are writing code that is reentrant
(see "SQLCA management for multi-threaded or reentrant code" on page 29
of the book ASA Programming Interfaces Guide). The sqlca should reference
a local variable. Any global or module static variable is subject to being
modified by another thread.
♦
SQL/92 Vendor extension.
♦
Sybase Not supported by Open Client/Open Server.
♦ The owning function could be found in a Windows DLL. Each
application that uses the DLL has its own 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 );
}
Function
Syntax
Permissions
Side effects
See also
Description
Standards and
compatibility
Example