|
saCommandHandles *NativeHandles();
Returns a
set of
command
related handles of native DBMS client
API.
Return value
A pointer to a base class saCommandHandles
from which a family of
DBMS implementation-specific classes are derived.
Remarks
You have to use native API handles when you
want to call DBMS specific API functions which are not directly
supported by the Library. API functions usually need to receive one
or more active handles as a parameter(s). NativeHandles method returns a pointer to the set of
native API command related
handles. To use API handles directly
you have to downcast saCommandHandles
pointer to the appropriate type
and use its implementation-specific members. If you need to use
connection related
handles see SAConnection::NativeHandles
method.
See DBMS
specific notes
section to know what type cast you have to
make and what additional header file you have to include to work
with specific DBMS client API. Note that for some DBMS using
appropriate type casting depends on an API version (that generally
mean that you have to explicitly check client version before
casting, see SAConnection::ClientVersion
method).
To get more information about DBMS API
functions and handles see this DBMS specific documentation.
Please be aware of the complications
associated with making direct API calls, as the internal logic of
the SQLAPI++ Library is not used. Besides, making direct API calls
reduces an application's portability.
DBMS specific notes
|
DBMS client |
Type casting |
|
Oracle 8
(OCI8) |
Cast the result to class
ora8CommandHandles:
#include
<oraAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles (); ora8CommandHandles *p_ora8CH
=
(ora8CommandHandles *)pResult;
Available handles:
- OCIStmt
*m_pOCIStmt;
- OCIError
*m_pOCIError;
|
|
Oracle 7
(OCI7) |
Cast the result to class
ora7CommandHandles:
#include
<ora7API.h>
saCommandHandles *pResult =
cmd.NativeHandles(); ora7CommandHandles *p_ora7CH =
(ora7CommandHandles *)pResult;
Available handles:
|
|
SQL
Server (OLE DB) |
Cast the result to class
ssOleDbCommandHandles:
#include
<ssOleDbAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles (); ssOleDbCommandHandles *p_ssOleDbCH
=
(ssOleDbCommandHandles *)pResult;
Available handles:
- ICommandText
*pICommandText;
-
IMultipleResults
*pIMultipleResults;
- IRowset
*pIRowset;
|
|
SQL
Server (DB-Library) |
Cast the result to class
ssCommandHandles:
#include
<ss6API.h>
saCommandHandles *pResult =
cmd.NativeHandles (); ssCommandHandles *p_ssCH
=
(ssCommandHandles *)pResult;
Available handles:
|
| Sybase
|
Cast the result to class
sybCommandHandles:
#include
<sybAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles (); sybCommandHandles *p_db2CH
=
(sybCommandHandles *)pResult;
Available handles:
|
|
DB2 |
Cast the result to class
db2CommandHandles:
#include
<db2API.h>
saCommandHandles *pResult =
cmd.NativeHandles (); db2CommandHandles *p_db2CH
=
(db2CommandHandles *)pResult;
Available handles:
|
|
Informix
|
Cast the result to class
infCommandHandles:
#include
<infAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles (); infCommandHandles *p_infCH
=
(infCommandHandles *)pResult;
Available handles:
|
|
InterBase |
Cast the result to class
ibCommandHandles:
#include
<ibAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles (); ibCommandHandles *p_ibCH
=
(ibCommandHandles *)pResult;
Available handles:
- isc_stmt_handle
m_stmt_handle;
|
|
SQLBase
|
Cast the result to class
sbCommandHandles:
#include
<sbAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles(); sbCommandHandles *p_sbCH
=
(sbCommandHandles *)pResult;
Available handles:
|
|
MySQL
|
Cast the result to class myCommandHandles:
#include <myAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles();
myCommandHandles *p_myCH
=
(myCommandHandles *)pResult;
Available handles:
|
|
PostgreSQL
|
Cast the result to class pgCommandHandles:
#include <pgAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles();
pgCommandHandles *p_pgCH
=
(pgCommandHandles *)pResult;
Available handles:
|
|
ODBC
|
Cast the result to class odbcCommandHandles:
#include <odbcAPI.h>
saCommandHandles *pResult =
cmd.NativeHandles();
odbcCommandHandles *p_odbcCH
=
(odbcCommandHandles *)pResult;
Available handles:
|
See also
SAConnection::ClientVersion,
SAConnection::NativeAPI, SACommand::NativeHandles
Problems and Questions
If
you haven't found the answer to your questions or
have some problems on using the Library, please, send e-mail to howto@sqlapi.com.
|