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

📄 otl3_exc_list.htm

📁 ISO_C++:C++_OTL开发文档
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
  <meta content="text/html; charset=iso-8859-1"
 http-equiv="Content-Type">
  <meta content="Sergei Kuchin" name="Author">
  <meta content="Mozilla/4.77 [en] (Win95; U) [Netscape]"
 name="GENERATOR">
  <meta
 content="OTL, Oracle, ODBC, DB2, CLI, database API, C++, Template Library"
 name="KeyWords">
  <title>OTL 4.0, OTL defined exceptions</title>
</head>
<body>
<center>
<h1>OTL 4.0, OTL defined exceptions</h1>
</center>
<h1>
<a name="otl_compile"></a>OTL defined exceptions</h1>
The following <a href="otl3_exception_class.htm">OTL exceptions</a>
can
be raised by the <a href="otl3_stream_class.htm">OTL stream </a>functions:
<p><a name="32000"></a><font size="+1"><b>Code=32000:</b> Incompatible
data
types in stream operation</font>
</p>
<ul>
  <li> <b>Cause: </b>The data type of a variable used in the current
stream operation
is not compatible with the declared stream format</li>
  <li> <b>Action: </b>Check placeholders and declarations of their
data
types</li>
</ul>
<font size="+1"><b>Code=32001:</b> Row must be full for flushing output
stream</font>
<ul>
  <li> <b>Cause: </b>Stream is open for output and has a format of
output
rows.
An output row is a tuple of all output variables put together. The
current
output row is not filled yet but the flush function is invoked. The
stream
buffer cannot be flushed until the current row of the output buffer is
full.</li>
  <li> <b>Action: </b>Fill the row first, then flush the stream.</li>
</ul>
<font size="+1"><b>Code=32004:</b> Not all input variables have been
initialized</font>
<ul>
  <li> <b>Cause: </b>stream has input variables but not all the
variables
have
been initialized. An attempt to read data from the stream was made.</li>
  <li> <b>Action: </b>Assign all input variables first.</li>
</ul>
<font size="+1"><b>Code=32004:</b> No input variables have been defined
in
SQL statement</font>
<ul>
  <li> <b>Cause:</b> Stream has no input variables. An attempt to
write
objects
into the stream via one of the operator &lt;&lt; was made.</li>
  <li> <b>Action:</b> Do not call the operator &lt;&lt; for streams
which
have
no input variables defined.</li>
</ul>
<a name="32008"></a><font size="+1"><b>Code=32005:</b> Input string
value
is too large to fit into the buffer</font>
<ul>
  <li> <b>Cause: </b>Stream is open for output, e.g. an INSERT
statement.
The
actual string value is larger than the buffer size, e.g. "123456789" is
the string and the placeholder was defined as :f2&lt;char[5]&gt;</li>
  <li> <b>Action: </b>Truncate the input string or increase the size
of
the buffer
of the placeholder &lt;char[<b>10</b>]&gt;</li>
</ul>
<font size="+1"><b>Code=32006:</b> Input otl_long_string value is too
large
to fit into the buffer</font>
<ul>
  <li> <b>Cause: </b>Stream is open for output, e.g. an INSERT
statement.
The
actual otl_long_string is larger than the buffer size, defined by
set_max_long_size(),
e.g. "123456789" is the long string and the following function call was
made set_max_long_size(5).</li>
  <li> <b>Action: </b>Truncate the input long string or increase the
size
of the
max long size: set_max_long_size(100)</li>
</ul>
<font size="+1"><b>Code=32007:</b> PL/SQL table size is too large
(&gt;32767)</font>
<ul>
  <li> <b>Cause: </b>Size of PL/SQL.table to be declared in
otl_stream is
too
large.</li>
  <li> <b>Action: </b>The maximum size of PL/SQL table is limited to
32767 elements.</li>
</ul>
<font size="+1"><b><a name="CLOB_32008"></a>Code=32008:</b> Writing
CLOB/BLOB in stream mode: actual size is greater than specified, trying
to store X1 bytes / Unicode characters at offset X2. New length: X3
would be bigger than length of lob: X4.&nbsp;</font>
<ul>
  <li> <b>Cause: </b>Actual number of bytes to be written into the
LOB
stream
is greater than specified in the otl_lob_stream::set_len() function.
X1-X4 are specified either in bytes or Unicode characters (in case if
#define OTL_UNICODE is used).<br>
  </li>
  <li> <b>Action: </b>Actual number of bytes to be written into the
LOB
stream
should match the number, specified in the set_len() function.</li>
</ul>
<font size="+1"><b>Code=32009:</b> Closing CLOB/BLOB in stream mode:
actual
size is not equal to specified size</font>
<ul>
  <li> <b>Cause: </b>When otl_lob_stream::close() is called, it turns
out
that
the number of bytes, written into the LOB stream, does not match the
number
of bytes, specified in otl_lob_stream::set_len().</li>
  <li> <b>Action: </b>Actual number of bytes to be written into the
LOB
stream
should match the number, specified in the set_len() function</li>
</ul>
<font size="+1"><b>Code=32010:</b> CLOB/BLOB stream is not open for
writing</font>
<ul>
  <li> <b>Cause: </b>An attempt was made to write into the LOB
stream,
which was
not initialized for writing.</li>
  <li> <b>Action: </b>LOB stream that is not open for writing, cannot
be
used
for writing.</li>
</ul>
<p><br>
<font size="+1"><b>Code=32011:</b> CLOB/BLOB stream is not open for
reading</font>
</p>
<ul>
  <li> <b>Cause: </b>An attempt was made to read from the LOB stream,
which was
not initialized for reading.</li>
  <li> <b>Action: </b>LOB stream that is not open for reading, cannot
be
used
for reading.</li>
</ul>
<p><br>
<font size="+1"><b>Code=32012:</b> First session must be started with
session_begin()</font>
</p>
<ul>
  <li> <b>Cause: </b>An attempt to call otl_connect::session_reopen()
was
made,
before calling session_begin().</li>
  <li> <b>Action: </b>Change the logic of the program to call
session_begin()
first, and only after that to call session_reopen().</li>
</ul>
<p><br>
<a name="32013"></a><font size="+1"><b>Code=32013:</b> Invalid bind
variable declaration</font>
</p>
<ul>
  <li> <b>Cause: </b>There was a typo in the bind variable
declaration,
e.g. :var&lt;date&gt;,
instead of :var&lt;timestamp&gt;.</li>
  <li> <b>Action: </b>Correct the typo and try again.</li>
</ul>
<p><br>
<a name="32014"></a><font size="+1"><b>Code=32014:</b> No stored
procedure
was found</font>
</p>
<ul>
  <li> <b>Cause: </b>Stored procedure name, being passed into <a
 href="otl3_stream_class.htm#create_stored_proc_call">otl_stream::create_stored_proc_call</a>,
cannot be found in the Oracle data dictionary.</li>
  <li> <b>Action: </b>Correct the stored procedure name, and try
again.</li>
</ul>
<p><br>
<a name="32015"></a><font size="+1"><b>Code=32015:</b> Unsupported
data type</font>
</p>
<ul>
  <li> <b>Cause: </b>Datatype of parameter of the stored procedure,
specified
in&nbsp; <a href="otl3_stream_class.htm#create_stored_proc_call">otl_stream::create_stored_proc_call</a>,
is unsupported.</li>
  <li> <a name="32015_action"></a><b>Action: </b>PL/SQL tables, as
stored
procedure
parameters, are not supported by create_stored_proc_call(). Also, if a
stored procedure, which returns a reference cursor as an output
parameter,
has INOUT, or OUT parameters, is not supported by
create_stored_proc_call().
What is supported by&nbsp; create_stored_proc_call() is as follows: (1)
stored procedures with scalar input/output paramaters; (2) a stored
procedure
with scalar input parameters only, which returns a reference cursor as
an output parameter, or as a stored function, returning a reference
cursor
as a return value.</li>
</ul>
<a name="32016"></a><font size="+1"><b>Code=32016:</b> Unsupported
procedure
type</font>
<ul>
  <li> <b>Cause: </b>Stored procedure name, being passed into <a
 href="otl3_stream_class.htm#create_stored_proc_call">otl_stream::create_stored_proc_call</a>,
is of unsupported type..</li>
  <li> <b>Action: </b>For more detail, see <a href="#32015_action">this</a>.</li>
</ul>
<a name="32017"></a><font size="+1"><b>Code=32017:</b> Stream buffer
size
can't be &gt; 1 in this case</font>
<ul>
  <li> <b>Cause: </b>In case if <a
 href="otl3_bind_variables.htm#varchar_long">varchar_long</a>, <a
 href="otl3_bind_variables.htm#raw_long">raw_long</a>
are used in a combination with OTL/OCIx, the only allowed stream buffer
size is 1.</li>
  <p><br>
In case if <a href="otl3_bind_variables.htm#clob">clob</a>, <a
 href="otl3_bind_variables.htm#blob">blob</a>
are used in a combination with OTL/OCIx, the only allowed stream buffer
size for INSERTs or UPDATEs is 1. Though, buffer sizes, larger than 1,
are allowed
for SELECT statements. </p>
  <p>This exception gets raised when the above limitations are
violated. <br>
&nbsp; </p>
  <li><b>Action: </b>Set the buffer size to 1.</li>
</ul>
<a name="32018"></a><font size="+1"><b>Code=32018:</b> ODBC / DB2 CLI
function
name is not recognized. It should be one of the following: SQLTables,
SQLColumns,
SQLProcedures, SQLColumnPrivileges, SQLTablePrivileges, SQLPrimaryKeys,
SQLProcedureColumns, SQLForeignKeys</font>
<ul>
  <li> <b>Cause: </b>A stream is being instantiated with a call to
ODBC /
DB2
CLI that returns a description of a system table catalog, or a
description
of table columns (see <a href="otl4_append_b.htm">appendix B</a> for
more
detail). The function name was not recognized as one from the list
above.</li>
  <br>
&nbsp;
  <li><b>Action: </b>Check the spelling of the function name
that is
being passed
into the stream, fix it, recompile the program, and try again.</li>
</ul>
<br>
<a name="32019"></a><font size="+1"><b>Code=32019:</b>
otl_stream::operator&gt;&gt;() should have been called before
otl_stream::operator int()</font>
<ul>
  <li><b>Cause: </b>One of the otl_stream::operators &gt;&gt;()
should have been called before calling <a
 href="otl3_stream_class.htm#operator_int">otl_stream::operator int</a>().
Operator int() works only for streams that have some output (SELECT
statements, stored procedures returning result sets, etc.). Otherwise,
the meaning of operator int() is not defined, so the operator returns
incorrect values, or values that do not make any sense, and do not
reflect anything meaningful. Therefore, this exception gets thrown as a
warning, when an attempt is made to call operator int() before any
operators &gt;&gt;() are called. That is, before anything was read from
the stream, and yet, operator int() is called, which does not make any
sense, because the operator returns an "end-of-file" (eof) status of
the stream, after something is supposed to be read from the stream. The
difference in semantic between operator int() and <a
 href="otl3_stream_class.htm#eof">eof</a>() is that eof() should be
called before anything is read from the stream, and operator int()
should be called after something is read from the stream. In other
words, operator int() returns a deferred end-of-file status of the

⌨️ 快捷键说明

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