SQLAllocHandle

This is a generic function for allocating environment, connection and statement handles.

This function replaces the old allocation functions for each individual handle types (SQLAllocEnv, SQLAllocConnection and SQLAllocStmt).

Syntax :

RETCODE SQLAllocHandle(handleType, inputHandle, outputHandle )

Arguments:

The arguments for SQLAllocHandle are listed in this Table.

NameTypeDescription
HandleTypeSQLSMALLINTThe type of handle to allocate
InputHandleSQLHANDLEThe handle to base on the new handle. This is either an environment or connection handle
OutputHandleSQLHANDLE*Pointer to the storage for the newly create handle

Usage:

An application allocates different handles to use with different API functions. The handle provides a context for each function. The supported handle types are listed in below table.

HandleTypeDescription
EnvironmentSQL_TYPE_ENVThis handle is used to create an environment
ConnectionSQL-TYPE_DBCA connection handle is used to open a connection to a specific CSQL Database
StatementSQL_TYPE_STMTThe statement handle contains information about the compiled SQL statement and its result set

Returns : SQLAllocHandle returns SQL_SUCCESS if it is successful. Otherwise it returns SQL_ERROR.


Back to CSQL ODBC API Reference

Page last modified on September 25, 2009, at 09:51 AM