📄 command_nativehandles.html
字号:
<html><head><meta name="KEYWORDS" content=" library, C++, Oracle, SQLServer, DB2, Sybase, Informix, InterBase, SQLBase, ODBC,
SQL, server, client, database, programming, development, software,
Win32, Windows, Linux, Unix, Solaris,
Microsoft, Borland, Centura, Gupta, IBM"><meta name="DESCRIPTION" content=
"SQLAPI++ is C++ library for accessing SQL databases (Oracle, SQLServer, Sybase, DB2, InterBase, SQLBase, Informix, ODBC).
It uses native APIs, provides low-level access to database-specific features."><title>SQLAPI++ Library - Online Documentation - SACommand::NativeHandles</title></head><body bgcolor="#ffffff" BACKGROUND="../images/bg.gif" text="#000000"><!--GlbHdr--> <table WIDTH="600" height="40" frame="hsides" BORDER="2" BORDERCOLOR="#004fcd" align="right" cellpadding="0" cellspacing="2" id="TABLE1">
<tr><!--class="GlbDefault"-->
<td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../index.html" style="TEXT-DECORATION: none">
<font color="white" size="3" face="sans-serif">
<b>Home</b></font></A></td></TD>
<td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../HowTo/index.html" style="TEXT-DECORATION: none"> <font color="white" size="3" face="sans-serif">
<b>How To</b></font></A></td><!--class="GlbActive"-->
<td width="70" bgcolor="#00bb00" bordercolor="black" align="middle"><A href="index.html" style="TEXT-DECORATION: none"> <font color="white" size="3" face="sans-serif">
<b>Online Documentation</b></font></A></td><!--class="GlbDefault"-->
<td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../Support/index.html" style="TEXT-DECORATION: none"> <font color="white" size="3" face="sans-serif">
<b>Support</b></font></A></td>
<td width=70 bgcolor=#000094 bordercolor=black align=middle><A href="../Download/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Download</b></font></A></td>
<td width="70" bgcolor="#000094" bordercolor="black" align="middle"><A href="../Order/index.html" style="TEXT-DECORATION: none"> <font color="white" size="3" face="sans-serif">
<b>Order</b></font></A></td> </tr>
</table>
<p> </p>
<p> </p>
<table width="100%">
<tr>
<td valign="top" width="165"><!--LeftMenu-->
<table frame="void" CELLSPACING="5" width="165">
<tr><td><p> </p></td>
</tr>
<tr>
<td><img align="middle" src="../images/red.gif" WIDTH="12" HEIGHT="12"><A href="Command.html" style="TEXT-DECORATION: none">
<font color="white" size="2" face="sans-serif">
SACommand</A> </FONT> </td>
</tr>
<tr>
<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Connection.html" style="TEXT-DECORATION: none">
<font color="white" size="2" face="sans-serif">
SAConnection</A> </FONT> </td>
</tr>
<tr>
<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Exception.html" style="TEXT-DECORATION: none">
<font color="white" size="2" face="sans-serif">
SAException</font></A> </td>
</tr>
<tr>
<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Field.html" style="TEXT-DECORATION: none">
<font color="white" size="2" face="sans-serif">
SAField</A> </FONT> </td>
</tr>
<tr>
<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="Param.html" style="TEXT-DECORATION: none">
<font color="white" size="2" face="sans-serif">
SAParam</A> </FONT> </td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="String.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAString</A> </FONT> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="DateTime.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SADateTime</A> </FONT> </td>
</tr>
</table>
</td><!--empty column-->
<td width="20">
<p> </p>
</td><!--Content-->
<td valign="top" align="left">
<table width="100%" cellspacing="2" cellpadding="2">
<tr>
<td align="left"><A href="Command_Usage.html" style="TEXT-DECORATION: none"><h3>Usage</h3></A>
</td>
<td align="left"><A href="Command.html" style="TEXT-DECORATION: none"><h3>Class Members</h3></A>
</td>
<td align="left"><A href="Command_Examples.html#NativeHandles" style="TEXT-DECORATION: none"><h3>Examples</h3></A>
</td>
</tr>
<tr>
<td colspan="3"><h1>SACommand::NativeHandles</h1></td>
</tr>
</table>
<p><font face="Arial"><b>saCommandHandles *NativeHandles();</b></font></p>
<p>
Returns a
set of
command
related handles of native DBMS client
API.
</p>
<H3>Return value</H3>
<P> A pointer to a base <STRONG
>class saCommandHandles</STRONG>
from which a family of
DBMS implementation-specific classes are derived.</P>
<h3>Remarks</h3>
<p>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). <STRONG>NativeHandles</STRONG> method returns a pointer to the set of
native API <STRONG>command related</STRONG>
handles. To use API handles directly
you have to downcast <STRONG>saCommandHandles</STRONG>
pointer to the appropriate type
and use its implementation-specific members. If you need to use
<STRONG>connection related</STRONG>
handles see <A
href="Connection_NativeHandles.html">SAConnection::NativeHandles</A>
method. </p>
<p>See <STRONG>DBMS
specific notes</STRONG>
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 <A
href="Connection_ClientVersion.html">SAConnection::ClientVersion</A>
method). </p>
<p>To get more information about DBMS API
functions and handles see this DBMS specific documentation.
</p>
<P><A name=idx45><!></A>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. </P>
<h3>DBMS specific notes</h3>
<p>
<table border=1 cellPadding=5 width=100%>
<TBODY>
<tr bgColor=#000094>
<td width=17%>
<p><STRONG><FONT color=white face="">DBMS client</FONT> </STRONG></p></td>
<td >
<P><STRONG><FONT color=white face="">Type casting</FONT> </STRONG></P></td>
</tr>
<tr>
<td>
<p><STRONG><A
href="../ServerSpecific/Oracle.html" title="Oracle server specific information">Oracle 8</A>
(OCI8)</STRONG></p></td>
<td>
<P><STRONG><FONT color=maroon
face="">Cast the result</FONT></STRONG> to <STRONG
>class
ora8CommandHandles</STRONG>:</P><FONT face=System><FONT face=System>
<P><STRONG><FONT color=maroon face="">#include
<oraAPI.h></FONT> </STRONG></P>
<P>saCommandHandles *pResult =
cmd.NativeHandles</FONT>();<BR>ora8CommandHandles *p_ora8CH
=<BR>
(ora8CommandHandles *)pResult; </p>
<P><FONT
face="Times New Roman"><STRONG><FONT color=maroon
face="">Available handles:</FONT></STRONG></FONT>
</P>
<UL>
<LI><FONT face="Times New Roman">OCIStmt
*m_pOCIStmt; </FONT>
<LI><FONT face="Times New Roman">OCIError
*m_pOCIError;</FONT></LI></UL></FONT>
</td>
</tr>
<tr>
<td >
<p><STRONG><A
href="../ServerSpecific/Oracle.html" title="Oracle server specific information">Oracle 7</A>
(OCI7)</STRONG></p></td>
<td>
<P><STRONG><FONT color=maroon
face="">Cast the result</FONT></STRONG> to <STRONG
>class
ora7CommandHandles</STRONG>:</P><FONT face=System>
<P><STRONG><FONT color=maroon face="">#include
<ora7API.h></FONT> </STRONG></P>
<P>saCommandHandles *pResult =
cmd.NativeHandles();<BR>ora7CommandHandles *p_ora7CH =
<BR>
(ora7CommandHandles *)pResult;</P>
<P><FONT
face="Times New Roman"><STRONG><FONT color=maroon
face="">Available handles:</FONT></STRONG></FONT>
</P>
<UL>
<LI><FONT face="Times New Roman">Cda_Def m_cda;</FONT></LI></UL>
</FONT></td>
</tr>
<tr>
<td>
<p><STRONG><A
href="../ServerSpecific/SQLServer_OleDb.html" title="SQL Server (OLE DB) specific information">SQL
Server (OLE DB)</A></STRONG> </p></td>
<td>
<P><STRONG><FONT color=maroon
face="">Cast the result</FONT></STRONG> to <STRONG
>class
ssOleDbCommandHandles</STRONG>:</P><FONT face=System><FONT face=System>
<P><STRONG><FONT color=maroon face="">#include
<ssOleDbAPI.h></FONT> </STRONG></P>
<P>saCommandHandles *pResult =
cmd.NativeHandles</FONT>();<BR>ssOleDbCommandHandles *p_ssOleDbCH
=<BR>
(ssOleDbCommandHandles *)pResult;</P>
<P><FONT
face="Times New Roman"><STRONG><FONT color=maroon
face="">Available handles:</FONT></STRONG></FONT>
</P>
<UL>
<LI><FONT face="Times New Roman"> ICommandText
*pICommandText;</FONT>
<LI><FONT face="Times New Roman">
</FONT><FONT
face="Times New Roman">IMultipleResults
*pIMultipleResults;</FONT>
<LI><FONT
face="Times New Roman"></FONT><FONT
face="Times New Roman">IRowset
*pIRowset;</FONT></LI>
</UL>
</FONT></td>
</tr>
<tr>
<td>
<p><STRONG><A
href="../ServerSpecific/SQLServer_DbLibrary.html" title="SQL Server (DB-Library) specific information">SQL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -