You must not use the option on the SQL preprocessor that generates non-reentrant code (-r-). The reentrant code is a little larger and a little slower because statically initialized global variables cannot be used. However, these effects are minimal.
Each SQLCA used in your program must be initialized with a call to db_init and cleaned up at the end with a call to db_fini.
The embedded SQL statement SET SQLCA is used to tell the SQL preprocessor to use a different SQLCA for database requests.
Usually, a statement such as
EXEC SQL SET SQLCA 'task_data->sqlca'; is used at the top of your program or in a header file to set the SQLCA reference to point at task specific data. Performance
is unaffected because this statement does not generate any code. It changes the state within the preprocessor so that any
reference to the SQLCA uses the given string.
For information about creating SQLCAs, see SET SQLCA statement [ESQL].
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|