⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 otl3_compile.htm

📁 otl是c++数据库封装好的一个数据库接口
💻 HTM
📖 第 1 页 / 共 5 页
字号:
when there is a need to overload operator>>(unsigned long&)
and
operator<<(const unsigned long). This #define, when enabled,
prevents OTL
from declaring private operator>>(unsigned long&) and
operator&lt;&lt;(const unsigned long) in the otl_stream class.</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_STRICT_NUMERIC_TYPE_CHECK_ON_SELECT"></a>OTL_STRICT_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">NUMERIC_TYPE_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">CHECK_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">ON_SELECT</span><br>
      </td>
      <td style="vertical-align: top;">By default on an SELECT
statement, or a stored procedure that returns an implcit result set
(ODBC, DB2 CLI) / a reference cursor (PL/SQL), OTL tries to describe
the [SELECT] output columns, and map internal datatypes to external C++
datatypes.&nbsp; In the case of internal numeric datatypes, the
corresponding external C++ datatypes may not have exactly the same
domain as the internal datatypes. And, say, the values are being read
into a variable of a third numeric datatype. In this case OTL has to
convert the values from one numeric datatype to another. This #define
(OTL_STRICT_NUMERIC_TYPE_CHECK_ON_SELECT) enforces the exact match
between the output variable's datatype that's the internal numeric
value is being read into, and the datatype of the internal value
itself. <br>
      <br>
In some cases, as it was mentioned in the previous paragraph, the
internal-to-external numeric datatype mapping is not exact. In those
case, the numeric [SELECT] column's datatype may be explicitly <a
 href="otl3_bind_variables.htm#SELECT_OVERRIDE">overriden</a> to ensure
the exact match between the internal and the external datatypes. Also,
if the external and internal datatypes match exactly, OTL provides a
small performance boost by avoiding any numeric datatype conversion. <br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><font size="-1"><a
 name="OTL_ODBC_SQL_EXTENDED_FETCH_ON"></a><b>OTL_ODBC_SQL<br>
_EXTENDED<br>
_FETCH_ON</b> <br>
      </font></td>
      <td style="vertical-align: top;">(for ODBC and
DB2-CLI). Forces
OTL to generate calls to
SQLExtendedFetch
(buffer size &gt; 1), or SQLFetch (buffer size ==1), instead of
SQLFetchScroll,
in case if the ODBC level is greater of equal to ODBC 3.0. This #define
is introduced to mainly fix a bug in DB2-CLI in Linux, and some ODBC
drivers,
when CLOBs/BLOBs are being fetched with SQLFetchScroll(). </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a
 name="OTL_ODBC_SELECT_STM_EXECUTE_BEFORE_DESCRIBE"></a><span
 style="font-weight: bold;">OTL_ODBC_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">SELECT_STM_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">EXECUTE_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">BEFORE_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">DESCRIBE</span><br>
      </td>
      <td style="vertical-align: top;">This #define (#define
OTL_ODBC_SELECT_STM_EXECUTE_BEFORE_DESCRIBE) should be used in a
combination with #define OTL_ODBC, and it changes the OTL stream's
default sequence of ODBC functions in the case of SELECT statement. The
default from sequence is as follows: SQLPrepare(),
SQLDescribeCol(),..., SQLBindParameter(),..., SQLExecute(), SQLFetch().
New ODBC drivers tend to do more optmization of database round-trips,
and they return the SELECT column descriptions along with the first
batch of rows. The ODBC specifation calls this kind of optimization an
implementaion detail, and leaves it up to the implometors of ODBC
driver. In the case of such optimization, the sequence of ODBC function
becomes this: SQPrepare(), SQLBindParameter(),..., SQLExecute(),
SQLDescribeCol(), ..., SQLFetch().<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ORA_DECLARE_COMMON_READ_STREAM_INTERFACE"></a>OTL_ORA_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">DECLARE_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">COMMON_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">READ_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">STREAM_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">INTERFACE</span><br>
      </td>
      <td style="vertical-align: top;">(for OCI8/8i/9i/10g only). Whe
this #define is enabled, OTL declares the following abstract /
interface class which both <a href="otl4_refcur_stream.htm">otl_refcur_stream</a>
and <a href="otl3_stream_class.htm">otl_stream</a> get derived from:<br>
      <br>
      <small><small><small><small><small><span
 style="font-family: monospace;">class otl_read_stream_interface{</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">public:</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; </span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual int is_null(void) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual void rewind(void) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual int eof(void) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(otl_datetime&amp; s) =
0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(char&amp; c) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(unsigned char&amp; c) =
0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp;
operator&gt;&gt;(OTL_STRING_CONTAINER&amp; s) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(char* s) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(unsigned char* s) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; operator&gt;&gt;(int&amp; n) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(unsigned&amp; u) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(short&amp; sh) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(long int&amp; l) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(float&amp; f) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(double&amp; d) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(otl_long_string&amp;
s) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual
otl_read_stream_interface&amp; </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">operator&gt;&gt;(otl_lob_stream&amp;
s) = 0;</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">&nbsp; virtual otl_column_desc* </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">describe_select(int&amp; desc_len) = 0;<br>
      <br>
&nbsp; <a name="describe_out_vars"></a>virtual otl_var_desc*
describe_out_vars(int&amp; desc_len);<br>
      </span></small></small></small></small></small>&nbsp;&nbsp;&nbsp;
      <span style="font-family: monospace;"><a
 name="describe_next_out_var"></a>virtual otl_var_desc*
describe_next_out_var(void);<br>
      </span><br>
&nbsp;&nbsp;&nbsp; <small><small><small><small><small><span
 style="font-family: monospace;">virtual
~otl_read_stream_interface(){}</span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><br>
      <small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;">};<br>
      <br>
      </span></small></small></small></small></small><small><small><small><small><small><span
 style="font-family: monospace;"></span></small></small></small></small></small>This
interface is useful when there is a lot of common code for
fetching rows either via otrl_stream or via otl_refcur_stream.<br>
      <br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><font size="-1"><a
 name="OTL_ORA_DOES_NOT_UNDEF_MIN_MAX"></a><b>OTL_ORA_<br>
DOES_NOT_<br>
UNDEF_<br>
MIN_MAX</b> </font></td>
      <td style="vertical-align: top;">OTL/OCI8/8i/9i/10g #undef's
#define min and #define max that are defined in one of the OCI header
files. This was done because in some cases min() and max() were
declared as functions in C++ standard header files. However, when ATL
is used, min() and max() are defined as #define's in "windef.h". If the
OTL header file is included after the windef.h file, the min() and
max() #defines get #undef''ined by OTL, so the symbols become
unavailable. When #define OTL_ORA_DOES_NOT_UNDEF_MIN_MAX) is enabled,
it makes OTL keep #define min and #define max as they were defined (if
they were defined).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><font size="-1"><a
 name="OTL_ORA_TEXT_ON"></a><b>OTL_ORA<br>
_TEXT_ON</b>. <br>
      </font></td>
      <td style="vertical-align: top;">When
fstream.h gets
included before the OTL header file, fstream.h declares object "text",
which is part of the C++ stream environment. Oracle OCI header files
use
symbol "text" as well. Depending on the platform and the C++ compiler,
symbol "text" is defined in OCI either as a typedef or a #define. In
any
case, it interferes with the C++ "text", defined in fstream.h. #define
OTL_ORA_TEXT_ON is introduced to fix the problem. So, all the user
needs
to do in order to make fstream.h and the OTL header compile together is
to put #define OTL_ORA_TEXT_ON before including the OTL header file,
and
after #include &lt;fstream.h&gt;. In the case of fstream.h being
include after
the OTL header file, #define OTL_ORA_TEXT_ON also needs to be defined
before
the inclusion of the OTL header file. </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><font size="-1"><a
 name="OTL_ORA_TIMESTAMP"></a><b>OTL_ORA<br>
_TIMESTAMP</b></font></td>
      <td style="vertical-align: top;">This
#define
enables support for Oracle 9i's timestamps, timestamps with time zones,
and timestamps with local time zones. The #define forces OTL to use the
OCI "OCIDateTime*" resource instead
of the OCI 7-byte date s

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -