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

📄 collection_8c-source.html

📁 oci的源码,可以在任何平台上编译,相当方便实用
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<a name="l00258"></a>00258 <a name="l00259"></a>00259     <span class="keywordflow">return</span> size;<a name="l00260"></a>00260 }<a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00263"></a>00263 <span class="comment"> * OCI_CollTrim</span><a name="l00264"></a>00264 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00265"></a>00265 <a name="l00266"></a><a class="code" href="group__g__collection.html#gc5e37e3a0fd362c8c3aa150d5cb66c51">00266</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__collection.html#gc5e37e3a0fd362c8c3aa150d5cb66c51" title="Trims the given number of elements from the end of the collection.">OCI_CollTrim</a>(<a class="code" href="struct_o_c_i___coll.html" title="Oracle Collections (VARRAYs and Nested Tables) representation.">OCI_Coll</a> *coll, <span class="keywordtype">int</span> nb_elem)<a name="l00267"></a>00267 {<a name="l00268"></a>00268     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00269"></a>00269 <a name="l00270"></a>00270     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, FALSE);<a name="l00271"></a>00271 <a name="l00272"></a>00272     OCI_CHECK_BOUND(coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>, nb_elem, 1, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#6d9fad8c88861770d8d825492fffaa5f">size</a>, FALSE);<a name="l00273"></a>00273 <a name="l00274"></a>00274     OCI_CALL2<a name="l00275"></a>00275     (<a name="l00276"></a>00276         res, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>,<a name="l00277"></a>00277 <a name="l00278"></a>00278         OCICollTrim(OCILib.env, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>-&gt;<a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, (sb4) nb_elem, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#cd0eeebc9c44bcabe4a2ef626d94bef1">handle</a>)<a name="l00279"></a>00279     )<a name="l00280"></a>00280 <a name="l00281"></a>00281     OCI_CollGetInternalSize(coll);<a name="l00282"></a>00282 <a name="l00283"></a>00283     OCI_RESULT(res);<a name="l00284"></a>00284 <a name="l00285"></a>00285     <span class="keywordflow">return</span> res;<a name="l00286"></a>00286 }<a name="l00287"></a>00287 <a name="l00288"></a>00288 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00289"></a>00289 <span class="comment"> * OCI_CollGetAt</span><a name="l00290"></a>00290 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00291"></a>00291 <a name="l00292"></a><a class="code" href="group__g__collection.html#g65523dc5e889b8d1e956674dd05e9b8b">00292</a> <a class="code" href="struct_o_c_i___elem.html" title="Oracle Collection item representation.">OCI_Elem</a> * OCI_API <a class="code" href="group__g__collection.html#g65523dc5e889b8d1e956674dd05e9b8b" title="Return the element at the given position in the collection.">OCI_CollGetAt</a>(<a class="code" href="struct_o_c_i___coll.html" title="Oracle Collections (VARRAYs and Nested Tables) representation.">OCI_Coll</a> *coll, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index)<a name="l00293"></a>00293 {<a name="l00294"></a>00294     <span class="keywordtype">boolean</span> res    = TRUE;<a name="l00295"></a>00295     <span class="keywordtype">boolean</span> exists = FALSE;<a name="l00296"></a>00296     <span class="keywordtype">void</span> *data     = NULL;<a name="l00297"></a>00297     OCIInd *p_ind  = NULL;<a name="l00298"></a>00298     <a class="code" href="struct_o_c_i___elem.html" title="Oracle Collection item representation.">OCI_Elem</a> *elem = NULL;<a name="l00299"></a>00299 <a name="l00300"></a>00300     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, NULL);<a name="l00301"></a>00301     OCI_CHECK_BOUND(coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>, (<span class="keywordtype">int</span>) index, 1, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#6d9fad8c88861770d8d825492fffaa5f">size</a>, FALSE);<a name="l00302"></a>00302 <a name="l00303"></a>00303     OCI_CALL2<a name="l00304"></a>00304     (<a name="l00305"></a>00305         res, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>,<a name="l00306"></a>00306 <a name="l00307"></a>00307         OCICollGetElem(OCILib.env, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>-&gt;<a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#cd0eeebc9c44bcabe4a2ef626d94bef1">handle</a>, (sb4) index-1,<a name="l00308"></a>00308                        &amp;exists, &amp;data, (dvoid **) (dvoid *) &amp;p_ind)<a name="l00309"></a>00309     )<a name="l00310"></a>00310 <a name="l00311"></a>00311     <span class="keywordflow">if</span> (res == TRUE &amp;&amp; exists == TRUE &amp;&amp; data != NULL)<a name="l00312"></a>00312     {<a name="l00313"></a>00313         elem = coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7d09c118ff0a39a1987405a26593136e">elem</a> = OCI_ElemInit(coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>, &amp;coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7d09c118ff0a39a1987405a26593136e">elem</a>,<a name="l00314"></a>00314                                          (OCIColl *) data, p_ind, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#868c64c81b8bf3ca88c7ca8a6e57af03">typinf</a>);<a name="l00315"></a>00315     }<a name="l00316"></a>00316 <a name="l00317"></a>00317     OCI_RESULT(res);<a name="l00318"></a>00318 <a name="l00319"></a>00319     <span class="keywordflow">return</span> elem;<a name="l00320"></a>00320 }<a name="l00321"></a>00321 <a name="l00322"></a>00322 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00323"></a>00323 <span class="comment"> * OCI_CollSetAt</span><a name="l00324"></a>00324 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00325"></a>00325 <a name="l00326"></a><a class="code" href="group__g__collection.html#g5fa6e43afbe0dc39b56b52f8e09dc29a">00326</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__collection.html#g5fa6e43afbe0dc39b56b52f8e09dc29a" title="Assign the given element value to the element at the given position in the collection...">OCI_CollSetAt</a>(<a class="code" href="struct_o_c_i___coll.html" title="Oracle Collections (VARRAYs and Nested Tables) representation.">OCI_Coll</a> *coll, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index, <a class="code" href="struct_o_c_i___elem.html" title="Oracle Collection item representation.">OCI_Elem</a> *elem)<a name="l00327"></a>00327 {<a name="l00328"></a>00328     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00329"></a>00329 <a name="l00330"></a>00330     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, FALSE);<a name="l00331"></a>00331     OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem, FALSE);<a name="l00332"></a>00332 <a name="l00333"></a>00333     OCI_CHECK_COMPAT(coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>, elem-&gt;<a class="code" href="struct_o_c_i___elem.html#845d0b0e17bedfda6cf12df01f5ffd5d">typinf</a>-&gt;<a class="code" href="struct_o_c_i___type_info.html#30783a0a4a5d15db8f8bfe90250f18a7">cols</a>[0].<a class="code" href="struct_o_c_i___column.html#93bfdf4f9926d4680f93356402177110">type</a> == coll-&gt;<a class="code" href="struct_o_c_i___coll.html#868c64c81b8bf3ca88c7ca8a6e57af03">typinf</a>-&gt;<a class="code" href="struct_o_c_i___type_info.html#30783a0a4a5d15db8f8bfe90250f18a7">cols</a>[0].<a class="code" href="struct_o_c_i___column.html#93bfdf4f9926d4680f93356402177110">type</a>, FALSE);<a name="l00334"></a>00334 <a name="l00335"></a>00335     OCI_CALL2<a name="l00336"></a>00336     (<a name="l00337"></a>00337         res, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>,<a name="l00338"></a>00338 <a name="l00339"></a>00339         OCICollAssignElem(OCILib.env, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>-&gt;<a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, (sb4) index, elem-&gt;<a class="code" href="struct_o_c_i___elem.html#c0d4f7331dec95693a62f16f58fd83b1">handle</a>,<a name="l00340"></a>00340                           elem-&gt;<a class="code" href="struct_o_c_i___elem.html#c6e12298a89c23a2d9c67d79be728246">ind</a>,coll-&gt;<a class="code" href="struct_o_c_i___coll.html#cd0eeebc9c44bcabe4a2ef626d94bef1">handle</a>)<a name="l00341"></a>00341     )<a name="l00342"></a>00342 <a name="l00343"></a>00343     OCI_RESULT(res);<a name="l00344"></a>00344 <a name="l00345"></a>00345     <span class="keywordflow">return</span> res;<a name="l00346"></a>00346 }<a name="l00347"></a>00347 <a name="l00348"></a>00348 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00349"></a>00349 <span class="comment"> * OCI_CollAppend</span><a name="l00350"></a>00350 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00351"></a>00351 <a name="l00352"></a><a class="code" href="group__g__collection.html#g8b92db49c038ae235ef85743194ace83">00352</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__collection.html#g8b92db49c038ae235ef85743194ace83" title="Append the given element at the end of the collection.">OCI_CollAppend</a>(<a class="code" href="struct_o_c_i___coll.html" title="Oracle Collections (VARRAYs and Nested Tables) representation.">OCI_Coll</a> *coll, <a class="code" href="struct_o_c_i___elem.html" title="Oracle Collection item representation.">OCI_Elem</a> *elem)<a name="l00353"></a>00353 {<a name="l00354"></a>00354     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00355"></a>00355 <a name="l00356"></a>00356     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, FALSE);<a name="l00357"></a>00357     OCI_CHECK_PTR(OCI_IPC_ELEMENT, elem, FALSE);<a name="l00358"></a>00358 <a name="l00359"></a>00359     OCI_CHECK_COMPAT(coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>, elem-&gt;<a class="code" href="struct_o_c_i___elem.html#845d0b0e17bedfda6cf12df01f5ffd5d">typinf</a>-&gt;<a class="code" href="struct_o_c_i___type_info.html#30783a0a4a5d15db8f8bfe90250f18a7">cols</a>[0].<a class="code" href="struct_o_c_i___column.html#93bfdf4f9926d4680f93356402177110">type</a> == coll-&gt;<a class="code" href="struct_o_c_i___coll.html#868c64c81b8bf3ca88c7ca8a6e57af03">typinf</a>-&gt;<a class="code" href="struct_o_c_i___type_info.html#30783a0a4a5d15db8f8bfe90250f18a7">cols</a>[0].<a class="code" href="struct_o_c_i___column.html#93bfdf4f9926d4680f93356402177110">type</a>, FALSE);<a name="l00360"></a>00360 <a name="l00361"></a>00361     OCI_CALL2<a name="l00362"></a>00362     (<a name="l00363"></a>00363         res, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>,<a name="l00364"></a>00364 <a name="l00365"></a>00365         OCICollAppend(OCILib.env, coll-&gt;<a class="code" href="struct_o_c_i___coll.html#7b4f1aa1b566e2e8d4e62844991aeed5">con</a>-&gt;<a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, elem-&gt;<a class="code" href="struct_o_c_i___elem.html#c0d4f7331dec95693a62f16f58fd83b1">handle</a>, elem-&gt;<a class="code" href="struct_o_c_i___elem.html#c6e12298a89c23a2d9c67d79be728246">ind</a>,<a name="l00366"></a>00366                       coll-&gt;<a class="code" href="struct_o_c_i___coll.html#cd0eeebc9c44bcabe4a2ef626d94bef1">handle</a>)<a name="l00367"></a>00367     )<a name="l00368"></a>00368 <a name="l00369"></a>00369     OCI_CollGetInternalSize(coll);<a name="l00370"></a>00370 <a name="l00371"></a>00371     OCI_RESULT(res);<a name="l00372"></a>00372 <a name="l00373"></a>00373     <span class="keywordflow">return</span> res;<a name="l00374"></a>00374 }<a name="l00375"></a>00375 <a name="l00376"></a>00376 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00377"></a>00377 <span class="comment"> * OCI_CollGetTypeInfo</span><a name="l00378"></a>00378 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00379"></a>00379 <a name="l00380"></a><a class="code" href="group__g__collection.html#gfe5b77f207c626e4a942a3080d2cb002">00380</a> <a class="code" href="struct_o_c_i___type_info.html" title="Type info metadata handle.">OCI_TypeInfo</a> * OCI_API <a class="code" href="group__g__collection.html#gfe5b77f207c626e4a942a3080d2cb002" title="Return the type info object associated to the collection.">OCI_CollGetTypeInfo</a>(<a class="code" href="struct_o_c_i___coll.html" title="Oracle Collections (VARRAYs and Nested Tables) representation.">OCI_Coll</a> *coll)<a name="l00381"></a>00381 {<a name="l00382"></a>00382     OCI_CHECK_PTR(OCI_IPC_COLLECTION, coll, NULL);<a name="l00383"></a>00383 <a name="l00384"></a>00384     OCI_RESULT(TRUE);<a name="l00385"></a>00385 <a name="l00386"></a>00386     <span class="keywordflow">return</span> coll-&gt;<a class="code" href="struct_o_c_i___coll.html#868c64c81b8bf3ca88c7ca8a6e57af03">typinf</a>;<a name="l00387"></a>00387 }</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sat Apr 18 01:13:08 2009 for OCILIB (C Driver for Oracle) by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address></body></html>

⌨️ 快捷键说明

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