Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » UltraLite - C and C++ Programming » Application development » UltraLite C++ application development using embedded SQL » UltraLite database connection using embedded SQL

 

Using multiple SQLCAs to manage multiple database connections

Use the SET SQLCA embedded SQL statement to tell the SQL preprocessor to use a specific SQLCA for database requests.

Prérequis

There are no prerequisites for this task.

 Task
  1. Initialize Each SQLCA used in your program with a call to db_init.

  2. At the top of your program or in a header file, set the SQLCA reference to point at task specific data:

    EXEC SQL SET SQLCA 'task_data->sqlca';

    This statement does not generate any code and does not affect performance.

Résultat

The state within the preprocessor changes so that any reference to the SQLCA uses the given string.

Suivant

Clean up resources when closing your application with a call to the db_fini method.

 See also