Administrative API Reference

sqleBeginCtx - Create and Attach to an Application Context

Creates an application context, or creates and then attaches to an application context. More than one application context can be created. Each context has its own commit scope. Different threads can attach to different contexts (see sqleAttachToCtx - Attach to Context). Any database API calls made by such threads will not be serialized with one another.

Scope

The scope of this API is limited to the immediate process.

Authorization

None

Required Connection

None

Version

sql.h

C API Syntax



int sqleBeginCtx (
void           **ppCtx,
sqlint32       lOptions,
void           *reserved,
struct sqlca   *pstSqlca);

API Parameters

ppCtx
Output. A data area allocated out of private memory for the storage of context information.

lOptions
Input. Valid values are:

SQL_CTX_CREATE_ONLY
The context memory will be allocated, but there will be no attachment.

SQL_CTX_BEGIN_ALL
The context memory will be allocated, and then a call to sqleAttachToCtx - Attach to Context will be made for the current thread. If this option is used, the ppCtx parameter can be NULL. If the thread is already attached to a context, the call will fail.

reserved
Reserved for future use. Must be set to NULL.

pstSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.


[ Top of Page | Previous Page | Next Page ]