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

📄 object_8c-source.html

📁 oci的源码,可以在任何平台上编译,相当方便实用
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00534"></a>00534     OCI_ObjectGetNumber(obj, attr, &amp;value, <span class="keyword">sizeof</span>(value), OCI_NUM_INT);<a name="l00535"></a>00535 <a name="l00536"></a>00536     <span class="keywordflow">return</span> value;<a name="l00537"></a>00537 }<a name="l00538"></a>00538 <a name="l00539"></a>00539 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00540"></a>00540 <span class="comment"> * OCI_ObjectGetUnsignedInt</span><a name="l00541"></a>00541 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00542"></a>00542 <a name="l00543"></a><a class="code" href="group__g__usertypes.html#g689f788d7a209d771e3bd58df9e2d107">00543</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__usertypes.html#g689f788d7a209d771e3bd58df9e2d107" title="Return the unsigned integer value of the given object attribute.">OCI_ObjectGetUnsignedInt</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00544"></a>00544 {<a name="l00545"></a>00545     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> value = 0;<a name="l00546"></a>00546 <a name="l00547"></a>00547     OCI_ObjectGetNumber(obj, attr, &amp;value, <span class="keyword">sizeof</span>(value), OCI_NUM_UINT);<a name="l00548"></a>00548 <a name="l00549"></a>00549     <span class="keywordflow">return</span> value;<a name="l00550"></a>00550 }<a name="l00551"></a>00551 <a name="l00552"></a>00552 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00553"></a>00553 <span class="comment"> * OCI_ObjectGetBigInt</span><a name="l00554"></a>00554 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00555"></a>00555 <a name="l00556"></a><a class="code" href="group__g__usertypes.html#gb54b3d47511ea08681f17469bd67a8be">00556</a> big_int OCI_API <a class="code" href="group__g__usertypes.html#gb54b3d47511ea08681f17469bd67a8be" title="Return the big integer value of the given object attribute.">OCI_ObjectGetBigInt</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00557"></a>00557 {<a name="l00558"></a>00558     big_int value = 0;<a name="l00559"></a>00559 <a name="l00560"></a>00560     OCI_ObjectGetNumber(obj, attr, &amp;value, <span class="keyword">sizeof</span>(value), OCI_NUM_BIGINT);<a name="l00561"></a>00561 <a name="l00562"></a>00562     <span class="keywordflow">return</span> value;<a name="l00563"></a>00563 }<a name="l00564"></a>00564 <a name="l00565"></a>00565 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00566"></a>00566 <span class="comment"> * OCI_ObjectGetUnsignedBigInt</span><a name="l00567"></a>00567 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00568"></a>00568 <a name="l00569"></a><a class="code" href="group__g__usertypes.html#g73200e2bdceefd839151825b2dcdfdc2">00569</a> big_uint OCI_API <a class="code" href="group__g__usertypes.html#g73200e2bdceefd839151825b2dcdfdc2" title="Return the unsigned big integer value of the given object attribute.">OCI_ObjectGetUnsignedBigInt</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00570"></a>00570 {<a name="l00571"></a>00571     big_uint value = 0;<a name="l00572"></a>00572 <a name="l00573"></a>00573     OCI_ObjectGetNumber(obj, attr, &amp;value, <span class="keyword">sizeof</span>(value), OCI_NUM_BIGUINT);<a name="l00574"></a>00574 <a name="l00575"></a>00575     <span class="keywordflow">return</span> value;<a name="l00576"></a>00576 }<a name="l00577"></a>00577 <a name="l00578"></a>00578 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00579"></a>00579 <span class="comment"> * OCI_ObjectGetDouble</span><a name="l00580"></a>00580 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00581"></a>00581 <a name="l00582"></a><a class="code" href="group__g__usertypes.html#g625c2fc05309303f698fd447f438d527">00582</a> <span class="keywordtype">double</span> OCI_API <a class="code" href="group__g__usertypes.html#g625c2fc05309303f698fd447f438d527" title="Return the double value of the given object attribute.">OCI_ObjectGetDouble</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00583"></a>00583 {<a name="l00584"></a>00584     <span class="keywordtype">double</span> value = 0.0;<a name="l00585"></a>00585 <a name="l00586"></a>00586     OCI_ObjectGetNumber(obj, attr, &amp;value, <span class="keyword">sizeof</span>(value), OCI_NUM_DOUBLE);<a name="l00587"></a>00587 <a name="l00588"></a>00588     <span class="keywordflow">return</span> value;<a name="l00589"></a>00589 }<a name="l00590"></a>00590 <a name="l00591"></a>00591 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00592"></a>00592 <span class="comment"> * OCI_ObjectGetString</span><a name="l00593"></a>00593 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00594"></a>00594 <a name="l00595"></a><a class="code" href="group__g__usertypes.html#g95ba08a32cf97b7bed6235cc48bd2300">00595</a> <span class="keyword">const</span> dtext * OCI_API <a class="code" href="group__g__usertypes.html#g95ba08a32cf97b7bed6235cc48bd2300" title="Return the string value of the given object attribute.">OCI_ObjectGetString</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00596"></a>00596 {<a name="l00597"></a>00597     <span class="keyword">const</span> dtext *str  = NULL;<a name="l00598"></a>00598     <span class="keywordtype">boolean</span> res       = FALSE;<a name="l00599"></a>00599     <span class="keywordtype">int</span> index         = OCI_ObjectGetIndex(obj, attr, OCI_CDT_TEXT);<a name="l00600"></a>00600 <a name="l00601"></a>00601     <span class="keywordflow">if</span> (index &gt;= 0)<a name="l00602"></a>00602     {<a name="l00603"></a>00603         OCIInd ind        = 0;<a name="l00604"></a>00604         OCIType *tdo      = NULL;<a name="l00605"></a>00605         OCIString **value = NULL;<a name="l00606"></a>00606 <a name="l00607"></a>00607         res = OCI_ObjectGetAttr(obj, attr, (dvoid **) (dvoid *) &amp;value, &amp;ind, &amp;tdo);<a name="l00608"></a>00608 <a name="l00609"></a>00609         <span class="keywordflow">if</span> ((res == TRUE) &amp;&amp; (value != NULL) &amp;&amp; (ind == OCI_IND_NOTNULL))<a name="l00610"></a>00610         {<a name="l00611"></a>00611             str = (dtext *) OCI_StringFromStringPtr(*value, &amp;obj-&gt;<a class="code" href="struct_o_c_i___object.html#96a0b7cfa2636dde43654219b0c2aa0a">buf</a>, &amp;obj-&gt;<a class="code" href="struct_o_c_i___object.html#ac7ef7304b9eebe653d1f6b00095de9e">buflen</a>);<a name="l00612"></a>00612         }<a name="l00613"></a>00613     }<a name="l00614"></a>00614 <a name="l00615"></a>00615     OCI_RESULT(res);<a name="l00616"></a>00616 <a name="l00617"></a>00617     <span class="keywordflow">return</span> str;<a name="l00618"></a>00618 }<a name="l00619"></a>00619 <a name="l00620"></a>00620 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00621"></a>00621 <span class="comment"> * OCI_ObjectGetRaw</span><a name="l00622"></a>00622 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00623"></a>00623 <a name="l00624"></a><a class="code" href="group__g__usertypes.html#g5f369b31baa374ac4c0d17d37e5f542a">00624</a> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__usertypes.html#g5f369b31baa374ac4c0d17d37e5f542a" title="Return the raw attribute value of the given object attribute into the given buffer...">OCI_ObjectGetRaw</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr, <span class="keywordtype">void</span> *buffer,<a name="l00625"></a>00625                              <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len)<a name="l00626"></a>00626 {<a name="l00627"></a>00627     <span class="keywordtype">boolean</span> res = FALSE;<a name="l00628"></a>00628     <span class="keywordtype">int</span> index   = OCI_ObjectGetIndex(obj, attr, OCI_CDT_RAW);<a name="l00629"></a>00629     ub4 raw_len = 0;<a name="l00630"></a>00630 <a name="l00631"></a>00631     <span class="keywordflow">if</span> (index &gt;= 0)<a name="l00632"></a>00632     {<a name="l00633"></a>00633         OCIInd ind     = 0;<a name="l00634"></a>00634         OCIType *tdo   = NULL;<a name="l00635"></a>00635         OCIRaw **value = NULL;<a name="l00636"></a>00636 <a name="l00637"></a>00637         res = OCI_ObjectGetAttr(obj, attr, (dvoid **) (dvoid *) &amp;value, &amp;ind, &amp;tdo);<a name="l00638"></a>00638 <a name="l00639"></a>00639         <span class="keywordflow">if</span> ((res == TRUE) &amp;&amp; (value != NULL) &amp;&amp; (ind == OCI_IND_NOTNULL))<a name="l00640"></a>00640         {<a name="l00641"></a>00641             OCI_CALL2<a name="l00642"></a>00642             (<a name="l00643"></a>00643                 res, obj-&gt;<a class="code" href="struct_o_c_i___object.html#8bde19100472fa2836e320e8e0878954">con</a>,<a name="l00644"></a>00644 <a name="l00645"></a>00645                 OCIRawAllocSize(OCILib.env, obj-&gt;<a class="code" href="struct_o_c_i___object.html#8bde19100472fa2836e320e8e0878954">con</a>-&gt;<a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, *value, (ub4*) &amp;raw_len)<a name="l00646"></a>00646             )<a name="l00647"></a>00647 <a name="l00648"></a>00648             <span class="keywordflow">if</span> (res == TRUE)<a name="l00649"></a>00649             {<a name="l00650"></a>00650                 <span class="keywordflow">if</span> (len &gt; raw_len)<a name="l00651"></a>00651                     len = raw_len;<a name="l00652"></a>00652 <a name="l00653"></a>00653                 memcpy(buffer, OCIRawPtr(OCILib.env, *value), len);<a name="l00654"></a>00654             }<a name="l00655"></a>00655         }<a name="l00656"></a>00656     }<a name="l00657"></a>00657 <a name="l00658"></a>00658     OCI_RESULT(res);<a name="l00659"></a>00659 <a name="l00660"></a>00660     <span class="keywordflow">return</span> len;<a name="l00661"></a>00661 }<a name="l00662"></a>00662 <a name="l00663"></a>00663 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00664"></a>00664 <span class="comment"> * OCI_ObjectGetDate</span><a name="l00665"></a>00665 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00666"></a>00666 <a name="l00667"></a><a class="code" href="group__g__usertypes.html#g482b6b2454951874790451be6bc810f7">00667</a> <a class="code" href="struct_o_c_i___date.html" title="Oracle internal date representation.">OCI_Date</a> * OCI_API <a class="code" href="group__g__usertypes.html#g482b6b2454951874790451be6bc810f7" title="Return the date value of the given object attribute.">OCI_ObjectGetDate</a>(<a class="code" href="struct_o_c_i___object.html" title="Oracle Named types representation.">OCI_Object</a> *obj, <span class="keyword">const</span> mtext *attr)<a name="l00668"></a>00668 {<a name="l00669"></a>00669     <a class="code" href="struct_o_c_i___date.html" title="Oracle internal date representation.">OCI_Date</a> * date = NU

⌨️ 快捷键说明

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