group__complex.html

来自「一个很好用的Linux/Unix下Oracle OCI开发接口封装库」· HTML 代码 · 共 1,170 行 · 第 1/5 页

HTML
1,170
字号
          <td class="md" nowrap>const void *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>param_addr</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>param_size</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>short *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>ind_addr</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>is_array</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bind a variable by position.
<p>
If is_array is 1, the parameters param_addr and ind_addr must point to arrays. ind_addr is optional and can be passed a NULL. The param_size is still the size of one array element, not the whole array size!<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sth</em>&nbsp;</td><td>
I - The statement handle </td></tr>
<tr><td valign=top><em>position</em>&nbsp;</td><td>
I - The bind parameter position in the string. Starts with  1 for the first. </td></tr>
<tr><td valign=top><em>param_type</em>&nbsp;</td><td>
I - The datatype of the bind parameter (see <a class="el" href="group__constants.html#a6">Constants</a>). </td></tr>
<tr><td valign=top><em>param_addr</em>&nbsp;</td><td>
I - The pointer to the parameter data. </td></tr>
<tr><td valign=top><em>param_size</em>&nbsp;</td><td>
I - The size of the object at param_addr in bytes. </td></tr>
<tr><td valign=top><em>ind_addr</em>&nbsp;</td><td>
I - The pointer to the NULL indicator variable (optional). </td></tr>
<tr><td valign=top><em>is_array</em>&nbsp;</td><td>
I - 1 means param_addr points to an array, 0 means a single variable.</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
<ul>
<li>SQLO_SUCCESS <li> &lt; 0 on error </ul>
</dl><dl compact><dt><b>Example:</b></dt><dd>
 <div class="fragment"><pre><span class="comment">/* $Id: group__complex.html,v 1.1 2005/01/13 02:56:43 cvsroot Exp $ */</span>
<span class="preprocessor">#include &lt;stdio.h&gt;</span>
<span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<span class="preprocessor">#include "examples.h"</span>

<a class="code" href="group__typedefs.html#a1">sqlo_stmt_handle_t</a> prepare_cursor(<a class="code" href="group__typedefs.html#a0">sqlo_db_handle_t</a> dbh, <span class="keywordtype">double</span> * min_salary)
{
  <a class="code" href="group__typedefs.html#a1">sqlo_stmt_handle_t</a> sth;                      <span class="comment">/* statement handle */</span>

  <span class="keywordflow">if</span> (0 &gt; (sth = <a class="code" href="group__complex.html#a0">sqlo_prepare</a>(dbh, 
                            <span class="stringliteral">"SELECT ENAME, SAL FROM EMP WHERE SAL &gt;= :salary ORDER BY 2,1"</span>)))
    error_exit(dbh, <span class="stringliteral">"sqlo_prepare"</span>);

  <span class="keywordflow">if</span> (<a class="code" href="group__constants.html#a3a25">SQLO_SUCCESS</a> != 
      <a class="code" href="group__complex.html#a3">sqlo_bind_by_pos</a>(sth, 1, <a class="code" href="group__constants.html#a6a57">SQLOT_FLT</a>, min_salary, <span class="keyword">sizeof</span>(<span class="keywordtype">double</span>), 0, 0))
    error_exit(dbh, <span class="stringliteral">"sqlo_bind_by_pos"</span>);

  <span class="keywordflow">return</span> sth;
}
<span class="comment">/* $Id: group__complex.html,v 1.1 2005/01/13 02:56:43 cvsroot Exp $ */</span>
</pre></div> </dl><dl compact><dt><b>See also: </b></dt><dd>
<a class="el" href="group__complex.html#a0">sqlo_prepare</a>, <a class="el" href="group__complex.html#a1">sqlo_bind_by_name</a>, <a class="el" href="group__complex.html#a5">sqlo_define_by_pos</a> </dl><dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="ex10_8c-example.html#a1">ex10.c</a>, <a class="el" href="ex13_8c-example.html#a2">ex13.c</a>, <a class="el" href="ex14_8c-example.html#a2">ex14.c</a>, <a class="el" href="ex15_8c-example.html#a1">ex15.c</a>, and <a class="el" href="ex16_8c-example.html#a1">ex16.c</a>.</dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="sqlora.h::sqlo_bind_by_pos2"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int sqlo_bind_by_pos2 </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__typedefs.html#a1">sqlo_stmt_handle_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>sth</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>position</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>param_type</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const void *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>param_addr</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>param_size</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>short *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>ind_addr</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned short *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>rcode_addr</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>skip_size</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bind a variable by position.
<p>
Bind the input variables. This new version supports arrays of structures. Set the skip_size to the size of the structure. rcode and ind must be part of the structure.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sth</em>&nbsp;</td><td>
I - The statement handle </td></tr>
<tr><td valign=top><em>position</em>&nbsp;</td><td>
I - The bind parameter position in the string. Starts with  1 for the first. </td></tr>
<tr><td valign=top><em>param_type</em>&nbsp;</td><td>
I - The datatype of the bind parameter (<a class="el" href="group__constants.html#a6">Constants</a>). </td></tr>
<tr><td valign=top><em>param_addr</em>&nbsp;</td><td>
I - The pointer to the parameter data. </td></tr>
<tr><td valign=top><em>param_size</em>&nbsp;</td><td>
I - The size of the object at param_addr in bytes. </td></tr>
<tr><td valign=top><em>ind_addr</em>&nbsp;</td><td>
I - The pointer to the NULL indicator variable (optional). </td></tr>
<tr><td valign=top><em>rcode_addr</em>&nbsp;</td><td>
I - The pointer to the variable that should return the column level </td></tr>
<tr><td valign=top><em>skip_size</em>&nbsp;</td><td>
I - In case into an array of structures, set to sizeof(your_struct), otherwise set it to 0.</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
<ul>
<li>SQLO_SUCCESS <li> &lt; 0 on error </ul>
</dl><dl compact><dt><b>See also: </b></dt><dd>
<a class="el" href="group__complex.html#a0">sqlo_prepare</a>, <a class="el" href="group__complex.html#a1">sqlo_bind_by_name</a>, <a class="el" href="group__complex.html#a5">sqlo_define_by_pos</a> </dl><dl compact><dt><b>Since: </b></dt><dd>
Version 2.2 </dl>    </td>
  </tr>
</table>
<a name="a2" doxytag="sqlora.h::sqlo_bind_ref_cursor"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int sqlo_bind_ref_cursor </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__typedefs.html#a1">sqlo_stmt_handle_t</a>&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>sth</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>cursor_name</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>sth2p</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bind a REF CURSOR.
<p>
Binds a ref cursor and returns a new sth, which you can use to retrieve the data. <dl compact><dt><b>Note: </b></dt><dd>
You can also use <a class="el" href="group__complex.html#a1">The advanced interface.</a> and supply as SQLOT_RSET as type and the address of the new statement handle as param_addr. All other parameters are ignored.</dl><dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sth</em>&nbsp;</td><td>

⌨️ 快捷键说明

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