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.
| Name | Type | Description |
| HandleType | SQLSMALLINT | The type of handle to allocate |
| InputHandle | SQLHANDLE | The handle to base on the new handle. This is either an environment or connection handle |
| OutputHandle | SQLHANDLE* | 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.
| Handle | Type | Description |
| Environment | SQL_TYPE_ENV | This handle is used to create an environment |
| Connection | SQL-TYPE_DBC | A connection handle is used to open a connection to a specific CSQL Database |
| Statement | SQL_TYPE_STMT | The 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