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

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » Embedded SQL API Reference

db_fini function Next Page

db_init function


Initializes the UltraLite runtime library.

Syntax

unsigned short db_init(SQLCA * sqlca ) ;

Returns
Remarks

You must call this function before you make any other UltraLite library call, and before you execute any embedded SQL command.

In most cases, you should only call this function once, passing the address of the global sqlca variable (as defined in the sqlca.h header file). If you have multiple execution paths in your application, you can use more than one db_init call, as long as each one has a separate sqlca pointer. This separate SQLCA pointer can be a user-defined one, or could be a global SQLCA that has been freed using db_fini.

In multi-threaded applications, each thread must call db_init to obtain a separate SQLCA. Carry out subsequent connections and transactions that use this SQLCA on a single thread.

Initializing the SQLCA also resets any settings from previously called ULEnable functions. If you re-initialize a SQLCA, you must issue any ULEnable functions the application requires.

See also