📄 group__easy.html
字号:
</table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Counts the number of items in the table. <p>Counts the number of items where field = value [AND where]<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>dbh</em> </td><td>I - A database handle </td></tr> <tr><td valign=top><em>table</em> </td><td>I - A table name </td></tr> <tr><td valign=top><em>colname</em> </td><td>I - A column name </td></tr> <tr><td valign=top><em>colval</em> </td><td>I - A column value </td></tr> <tr><td valign=top><em>where</em> </td><td>I - More conditions (optional)</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd><ul><li>SQLO_SUCCESS </li><li>SQLO_NO_DATA </li><li>< 0 on error </li></ul></dd></dl><dl compact><dt><b>Example:</b></dt><dd><div class="fragment"><pre><span class="comment">/* $Id: ex2.c,v 1.4 2002/08/24 12:54:47 kpoitschke Exp $ */</span><span class="preprocessor">#include <stdio.h></span><span class="preprocessor">#include <stdlib.h></span><span class="preprocessor">#include "examples.h"</span><span class="keywordtype">int</span> col_count(<a class="code" href="group__typedefs.html#ga0">sqlo_db_handle_t</a> dbh, <span class="keywordtype">char</span> * table_name){ <span class="keywordtype">int</span> stat; <span class="keywordflow">if</span> ( 0 > (stat = <a class="code" href="group__easy.html#ga161">sqlo_count</a>(dbh, <span class="stringliteral">"USER_TAB_COLUMNS"</span>, <span class="stringliteral">"TABLE_NAME"</span>, table_name, NULL))) { error_exit(dbh, <span class="stringliteral">"sqlo_count"</span>); } <span class="keywordflow">return</span> stat;}<span class="comment">/* $Id: ex2.c,v 1.4 2002/08/24 12:54:47 kpoitschke Exp $ */</span></pre></div> </dd></dl><p>Definition at line <a class="el" href="sqlora_8c-source.html#l04902">4902</a> of file <a class="el" href="sqlora_8c-source.html">sqlora.c</a>.<p>References <a class="el" href="sqlora_8c-source.html#l04319">_get_trace_fp()</a>, <a class="el" href="sqlora_8c-source.html#l00340">CHECK_DBHANDLE</a>, <a class="el" href="sqlora_8c-source.html#l00416">CHECK_OCI_STATUS_RETURN</a>, <a class="el" href="sqlora_8c-source.html#l00495">_sqlo_db_struct::errmsg</a>, <a class="el" href="sqlora_8c-source.html#l05656">sqlo_close()</a>, <a class="el" href="sqlora_8c.html#a30">sqlo_db_struct_ptr_t</a>, <a class="el" href="group__constants.html#gga3a26">SQLO_ERROR</a>, <a class="el" href="sqlora_8c-source.html#l05367">sqlo_fetch()</a>, <a class="el" href="group__constants.html#gga4a34">SQLO_INVALID_DB_HANDLE</a>, <a class="el" href="sqlora_8c-source.html#l05238">sqlo_open2()</a>, <a class="el" href="group__constants.html#gga3a28">SQLO_STILL_EXECUTING</a>, <a class="el" href="sqlora_8h-source.html#l00318">sqlo_stmt_handle_t</a>, <a class="el" href="group__constants.html#gga3a25">SQLO_SUCCESS</a>, <a class="el" href="sqlora_8c-source.html#l05454">sqlo_values()</a>, and <a class="el" href="sqlora_8c-source.html#l00238">TRACE</a>. </td> </tr></table><p>Here is the call graph for this function:<p><center><img src="group__easy_ga1_cgraph.png" border="0" usemap="#group__easy_ga1_cgraph_map" alt=""></center><map name="group__easy_ga1_cgraph_map"><area href="sqlora_8c.html#a128" shape="rect" coords="643,437,739,456" alt=""><area href="group__easy.html#ga14" shape="rect" coords="481,56,556,74" alt=""><area href="group__easy.html#ga6" shape="rect" coords="301,382,373,401" alt=""><area href="group__easy.html#ga4" shape="rect" coords="144,338,224,357" alt=""><area href="group__easy.html#ga7" shape="rect" coords="296,682,379,701" alt=""><area href="sqlora_8c.html#a104" shape="rect" coords="641,101,740,120" alt=""><area href="sqlora_8c.html#a120" shape="rect" coords="636,153,745,172" alt=""><area href="sqlora_8c.html#a110" shape="rect" coords="649,628,732,646" alt=""><area href="sqlora_8c.html#a109" shape="rect" coords="644,56,737,74" alt=""><area href="sqlora_8c.html#a103" shape="rect" coords="643,12,739,30" alt=""><area href="sqlora_8c.html#a107" shape="rect" coords="483,293,555,312" alt=""><area href="sqlora_8c.html#a91" shape="rect" coords="461,250,576,269" alt=""><area href="sqlora_8c.html#a152" shape="rect" coords="449,530,588,549" alt=""><area href="sqlora_8c.html#a108" shape="rect" coords="305,246,369,265" alt=""><area href="sqlora_8c.html#a129" shape="rect" coords="485,437,552,456" alt=""><area href="sqlora_8c.html#a119" shape="rect" coords="273,340,401,358" alt=""><area href="sqlora_8c.html#a133" shape="rect" coords="291,204,384,222" alt=""><area href="sqlora_8c.html#a102" shape="rect" coords="299,105,376,124" alt=""><area href="sqlora_8c.html#a95" shape="rect" coords="477,725,560,744" alt=""></map><a class="anchor" name="ga15" doxytag="sqlora.h::sqlo_exec" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int sqlo_exec </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__typedefs.html#ga0">sqlo_db_handle_t</a> </td> <td class="mdname" nowrap> <em>dbh</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>stmt</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Execute a simple sql statement. <p>Use this to execute non-qeuery statements without bind variables.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>dbh</em> </td><td>A database handle </td></tr> <tr><td valign=top><em>stmt</em> </td><td>A sql statement</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of processed rows (DML statements), 0 (non DML statements) or < 0 on error.</dd></dl><dl compact><dt><b>Example: </b></dt><dd><div class="fragment"><pre><span class="comment">/* $Id: ex8.c,v 1.4 2002/08/24 12:54:47 kpoitschke Exp $ */</span><span class="preprocessor">#include <stdio.h></span><span class="preprocessor">#include <stdlib.h></span><span class="preprocessor">#include "examples.h"</span><span class="keywordtype">int</span> update_emp(<a class="code" href="group__typedefs.html#ga0">sqlo_db_handle_t</a> dbh, <span class="keywordtype">double</span> factor, <span class="keyword">const</span> <span class="keywordtype">char</span> * job){ <span class="keywordtype">int</span> stat; <span class="keywordtype">char</span> stmt[1024]; sprintf(stmt, <span class="stringliteral">"UPDATE EMP SET SAL = SAL * %f WHERE JOB = '%s'"</span>, factor, job); <span class="keywordflow">if</span> ( 0 > (stat = <a class="code" href="group__easy.html#ga163">sqlo_exec</a>(dbh, stmt))) error_exit(dbh, <span class="stringliteral">"sqlo_run"</span>); <span class="keywordflow">return</span> stat; <span class="comment">/* number of processed rows */</span>}<span class="comment">/* $Id: ex8.c,v 1.4 2002/08/24 12:54:47 kpoitschke Exp $ */</span></pre></div></dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__easy.html#ga2">sqlo_run</a> </dd></dl><p>Definition at line <a class="el" href="sqlora_8c-source.html#l05046">5046</a> of file <a class="el" href="sqlora_8c-source.html">sqlora.c</a>.<p>References <a class="el" href="sqlora_8c-source.html#l04319">_get_trace_fp()</a>, <a class="el" href="sqlora_8c-source.html#l00340">CHECK_DBHANDLE</a>, <a class="el" href="sqlora_8c-source.html#l00416">CHECK_OCI_STATUS_RETURN</a>, <a class="el" href="sqlora_8c-source.html#l00489">_sqlo_db_struct::envhp</a>, <a class="el" href="sqlora_8c-source.html#l00483">_sqlo_db_struct::errhp</a>, <a class="el" href="sqlora_8c.html#a30">sqlo_db_struct_ptr_t</a>, <a class="el" href="group__constants.html#gga4a34">SQLO_INVALID_DB_HANDLE</a>, <a class="el" href="group__constants.html#gga3a28">SQLO_STILL_EXECUTING</a>, <a class="el" href="sqlora_8c-source.html#l00493">_sqlo_db_struct::status</a>, <a class="el" href="sqlora_8c-source.html#l00500">_sqlo_db_struct::stmthp</a>, <a class="el" href="sqlora_8c-source.html#l00485">_sqlo_db_struct::svchp</a>, and <a class="el" href="sqlora_8c-source.html#l00238">TRACE</a>.<p>Referenced by <a class="el" href="sqlora_8c-source.html#l04733">sqlo_trace()</a>. </td> </tr></table><p>Here is the call graph for this function:<p><center><img src="group__easy_ga15_cgraph.png" border="0" usemap="#group__easy_ga15_cgraph_map" alt=""></center><map name="group__easy_ga15_cgraph_map"><area href="sqlora_8c.html#a128" shape="rect" coords="140,5,236,23" alt=""></map><a class="anchor" name="ga0" doxytag="sqlora.h::sqlo_exists" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int sqlo_exists </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__typedefs.html#ga0">sqlo_db_handle_t</a> </td> <td class="mdname" nowrap> <em>dbh</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>table</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>colname</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>colval</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>where</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -