📄 db2.html
字号:
href="../HowTo/connect.html">How To - Connecting to databases</A>, <A
href="../OnLineDoc/Connection_Usage.html">SAConnection object</A>, <A
href="../OnLineDoc/Connection_Connect.html">SAConnection::Connect</A>.</P>
<P> </P>
<H3><A
name="Transaction isolation levels">Transaction isolation
levels</A> </H3>
<P>SQL-92 defines four isolation levels, all of
which are supported by SQLAPI++:</P>
<UL>
<LI>Read uncommitted (the lowest level where
transactions are isolated just enough to ensure that physically
corrupt data is not read)
<LI>Read committed
<LI>Repeatable read
<LI>Serializable (the highest level, where
transactions are completely isolated from one another)</LI></UL>
<P>SQLAPI++ maps different isolation levels on
<STRONG>DB2</STRONG> server in the following way:</P>
<P> <STRONG
>SA_ReadUncommitted</STRONG> = SQL_TXN_READ_UNCOMMITTED
('Uncommited
Read')<BR><STRONG> SA_ReadCommitted</STRONG> =
SQL_TXN_READ_COMMITTED
('Cursor Stability')<BR><STRONG> SA_RepeatableRead</STRONG> = SQL_TXN_REPEATABLE_READ ('Repeatable
Read')<BR><STRONG> SA_Serializable</STRONG> = SQL_TXN_SERIALIZABLE
('Read
Stability')</P>
<P>For more details see <A
href="../OnLineDoc/Connection_setIsolationLevel.html">SAConnection::setIsolationLevel</A>.</P>
<P> </P>
<H3><A
name="Working with Long or Lob(CLob, BLob) data">Working with Long or Lob(CLob,
BLob) data</A> </H3>
<P>
SQLAPI++ supports four types for working with
Long or Lob(CLob, BLob) data:</P>
<P>
<TABLE border=1 cellPadding=1 cellSpacing=1 style="WIDTH: 100%"
width=100%>
<TR bgColor=navy>
<TD><FONT color=white
style="BACKGROUND-COLOR: #000080">Name</FONT></TD>
<TD><FONT color=white
style="BACKGROUND-COLOR: #000080">C
enum constant</FONT></TD>
</TR>
<TR>
<TD>LongBinary</TD>
<TD>SA_dtLongBinary</TD>
</TR>
<TR>
<TD>LongChar</TD>
<TD>SA_dtLongChar</TD>
</TR>
<TR>
<TD>BLob (Binary Large object)</TD>
<TD>SA_dtBLob</TD>
</TR>
<TR>
<TD>CLob (Character Large object)</TD>
<TD>SA_dtCLob</TD>
</TR></TABLE></P>
<P>The table below shows how SQLAPI++ data
types correspond with servers original data types:</P>
<P><EM>SA_dtLongBinary</EM> <= > LONG VARGRAPHIC<BR><EM>SA_dtLongChar</EM>
<= > LONG VARCHAR<BR
><EM>SA_dtBLob</EM> = >
BLOB<BR><EM>SA_dtCLob
</EM>=> CLOB, DBCLOB</EM></P>
<P>
For more details see <A href="../HowTo/blobs.html">How To - Working with Long or Lob(CLob, BLob) data</A></P>
<P> </P>
<H3><A
name="Returning output parameters">Returning output
parameters</A> </H3>
<P>
In <STRONG>DB2</STRONG>
output parameters are
available immediately after calling
<A
href="../OnLineDoc/Command_Execute.html">SACommand::Execute</A>
.</P>
<P>SQLAPI++ Library automatically creates
<A href="../OnLineDoc/Param.html" >SAParam</A>
object to represent function
return value. You can refer to this
<A href="../OnLineDoc/Param.html" >
SAParam</A>
object using SQLAPI++ predefined
name
<STRONG> "RETURN_VALUE"</STRONG>.</P>
<P>For more details see <A
href="../OnLineDoc/Command_Execute.html" >SACommand::Execute</A>,
<A href="../OnLineDoc/Param_Usage.html" >SAParam
object</A>, <A
href="../HowTo/return_param.html" >How To - Returning Output Parameters</A>.</P>
<P> </P>
<H3><A name="Cancelling queries">Cancelling
queries</A> </H3>
<P>Using <A href="../OnLineDoc/Command_Cancel.html" >SACommand::Cancel</A> method you
can cancel the following types of processing on a statement:</P>
<UL type=disc>
<LI>A function running asynchronously on
the statement.<BR>
<LI>A function running on the statement on
another thread. </LI></UL>
<p>SQLAPI++ calls <STRONG>SQLCancel</STRONG> function to cancel a query. To get more
details see <STRONG>SQLCancel</STRONG> function
description in <STRONG>DB2</STRONG>
documentation.</p>
<P>For more details see <A href="../OnLineDoc/Command_Cancel.html" >SACommand::Cancel</A>.</P>
<P> </P>
<H3><A
name="Connection and command options">Connection, command, parameter and field
options</A> </H3>
<P>A server specific option can relate to a
connection, command, parameter or field. We recommend you
specify each option in an appropriate object, although it is
possible to specify them in the parental object as well. In that
case the option affects all the child objects. </P>
<P>A connection related option must be specified
in a <A href="../OnLineDoc/Connection.html">SAConnection</A>
object. </P>
<P>A command related option may be specified in
either <A href="../OnLineDoc/Connection.html">SAConnection</A>
object or <A href="../OnLineDoc/Command.html">SACommand</A>
object. If it is specified
in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands on that connection. </P>
<P>A parameter related option may be specified in
<A href="../OnLineDoc/Connection.html">SAConnection</A>
object, <A href="../OnLineDoc/Command.html">SACommand</A>
object or <A href="../OnLineDoc/Param.html">SAParam</A>
object. If it is specified in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands and therefore all the parameters on that connection. If
it is specified in <A href="../OnLineDoc/Command.html">SACommand</A>
object it affects all the
parameters on that command. </P>
<P>A field related option may be specified in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object, <A href="../OnLineDoc/Command.html">SACommand</A>
object or <A href="../OnLineDoc/Field.html">SAField</A>
object. If it is specified in <A href="../OnLineDoc/Connection.html">SAConnection</A>
object it affects all
the commands and therefore all the fields on that connection. If it
is specified in <A href="../OnLineDoc/Command.html">SACommand</A>
object it affects all the
fields on that command. </P>
<P> Specific options for
<STRONG>
DB2</STRONG>:</P>
<P>
<TABLE border=1 cellPadding=5 width=100%>
<TBODY>
<TR bgColor=#000094>
<TD width=17%>
<P><STRONG><FONT
color=white face="">Option name /
Scope</FONT> </STRONG></P></TD>
<TD>
<P><STRONG><FONT
color=white face="">Description</FONT> </STRONG></P></TD></TR>
<TR>
<TD><STRONG>
<P align=center><STRONG>PreFetchRows</STRONG></P></STRONG>
<P align=center>Command related.
Should be specified before command execution.<STRONG><STRONG></STRONG></STRONG></P></TD>
<TD>
<P>Forces SQLAPI++ Library to fetch
rows in bulk, rather than retrieving records one by
one.</P>
<P><EM>Valid values</EM>: String containing number of rows in the fetch
buffer. <BR><EM>Default value</EM>:
"1".</P></TD></TR>
<TR>
<TD><STRONG>
<P align=center>ReturnStatus</P></STRONG>
<P align=center>Command related.
Should be specified before describing parameters or
command execution.<STRONG></STRONG></P></TD>
<TD>
<P>DB2 stored procedures always return a value, and SQLAPI++
automatically creates
<STRONG>SAParam</STRONG> object to
represent the function return value. This option allows to cancel
creating this
<STRONG>SAParam</STRONG>
object.</P>
<P><EM>Valid values</EM>: "Ignore" (SQLAPI++ does not create
<STRONG>SAParam</STRONG>
object to represent
function return value), "Default" (SQLAPI++
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -