📄 object_8c-source.html
字号:
<a name="l00394"></a>00394 {<a name="l00395"></a>00395 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> value = 0;<a name="l00396"></a>00396 <a name="l00397"></a>00397 OCI_ObjectGetNumber(obj, attr, &value, <span class="keyword">sizeof</span>(value), OCI_NUM_UINT);<a name="l00398"></a>00398 <a name="l00399"></a>00399 <span class="keywordflow">return</span> value;<a name="l00400"></a>00400 }<a name="l00401"></a>00401 <a name="l00402"></a>00402 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00403"></a>00403 <span class="comment"> * OCI_ObjectGetBigInt</span><a name="l00404"></a>00404 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00405"></a>00405 <a name="l00406"></a><a class="code" href="group__g__usertypes.html#gb54b3d47511ea08681f17469bd67a8be">00406</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="l00407"></a>00407 {<a name="l00408"></a>00408 big_int value = 0;<a name="l00409"></a>00409 <a name="l00410"></a>00410 OCI_ObjectGetNumber(obj, attr, &value, <span class="keyword">sizeof</span>(value), OCI_NUM_BIGINT);<a name="l00411"></a>00411 <a name="l00412"></a>00412 <span class="keywordflow">return</span> value;<a name="l00413"></a>00413 }<a name="l00414"></a>00414 <a name="l00415"></a>00415 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00416"></a>00416 <span class="comment"> * OCI_ObjectGetUnsignedBigInt</span><a name="l00417"></a>00417 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00418"></a>00418 <a name="l00419"></a><a class="code" href="group__g__usertypes.html#g73200e2bdceefd839151825b2dcdfdc2">00419</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="l00420"></a>00420 {<a name="l00421"></a>00421 big_uint value = 0;<a name="l00422"></a>00422 <a name="l00423"></a>00423 OCI_ObjectGetNumber(obj, attr, &value, <span class="keyword">sizeof</span>(value), OCI_NUM_BIGUINT);<a name="l00424"></a>00424 <a name="l00425"></a>00425 <span class="keywordflow">return</span> value;<a name="l00426"></a>00426 }<a name="l00427"></a>00427 <a name="l00428"></a>00428 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00429"></a>00429 <span class="comment"> * OCI_ObjectGetDouble</span><a name="l00430"></a>00430 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00431"></a>00431 <a name="l00432"></a><a class="code" href="group__g__usertypes.html#g625c2fc05309303f698fd447f438d527">00432</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="l00433"></a>00433 { <a name="l00434"></a>00434 <span class="keywordtype">double</span> value = 0.0;<a name="l00435"></a>00435 <a name="l00436"></a>00436 OCI_ObjectGetNumber(obj, attr, &value, <span class="keyword">sizeof</span>(value), OCI_NUM_DOUBLE);<a name="l00437"></a>00437 <a name="l00438"></a>00438 <span class="keywordflow">return</span> value;<a name="l00439"></a>00439 }<a name="l00440"></a>00440 <a name="l00441"></a>00441 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00442"></a>00442 <span class="comment"> * OCI_ObjectGetString</span><a name="l00443"></a>00443 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00444"></a>00444 <a name="l00445"></a><a class="code" href="group__g__usertypes.html#g95ba08a32cf97b7bed6235cc48bd2300">00445</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="l00446"></a>00446 {<a name="l00447"></a>00447 <span class="keyword">const</span> dtext *str = NULL;<a name="l00448"></a>00448 <span class="keywordtype">boolean</span> res = FALSE;<a name="l00449"></a>00449 <span class="keywordtype">int</span> index = OCI_ObjectGetIndex(obj, attr, OCI_CDT_TEXT);<a name="l00450"></a>00450 <a name="l00451"></a>00451 <span class="keywordflow">if</span> (index >= 0)<a name="l00452"></a>00452 {<a name="l00453"></a>00453 OCIInd ind = 0;<a name="l00454"></a>00454 OCIType *tdo = NULL;<a name="l00455"></a>00455 OCIString **value = NULL;<a name="l00456"></a>00456 <a name="l00457"></a>00457 res = OCI_ObjectGetAttr(obj, attr, (<span class="keywordtype">void</span> **) &value, &ind, &tdo);<a name="l00458"></a>00458 <a name="l00459"></a>00459 <span class="keywordflow">if</span> ((res == TRUE) && (value != NULL))<a name="l00460"></a>00460 { <a name="l00461"></a>00461 str = (dtext *) OCI_StringFromStringPtr(*value, &obj-><a class="code" href="struct_o_c_i___object.html#96a0b7cfa2636dde43654219b0c2aa0a">buf</a>, &obj-><a class="code" href="struct_o_c_i___object.html#ac7ef7304b9eebe653d1f6b00095de9e">buflen</a>);<a name="l00462"></a>00462 }<a name="l00463"></a>00463 }<a name="l00464"></a>00464 <a name="l00465"></a>00465 OCI_RESULT(res);<a name="l00466"></a>00466 <a name="l00467"></a>00467 <span class="keywordflow">return</span> str; <a name="l00468"></a>00468 }<a name="l00469"></a>00469 <a name="l00470"></a>00470 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00471"></a>00471 <span class="comment"> * OCI_ObjectGetRaw</span><a name="l00472"></a>00472 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00473"></a>00473 <a name="l00474"></a><a class="code" href="group__g__usertypes.html#g5f369b31baa374ac4c0d17d37e5f542a">00474</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="l00475"></a>00475 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len)<a name="l00476"></a>00476 {<a name="l00477"></a>00477 <span class="keywordtype">boolean</span> res = FALSE;<a name="l00478"></a>00478 <span class="keywordtype">int</span> index = OCI_ObjectGetIndex(obj, attr, OCI_CDT_RAW);<a name="l00479"></a>00479 ub4 raw_len = 0;<a name="l00480"></a>00480 <a name="l00481"></a>00481 <span class="keywordflow">if</span> (index >= 0)<a name="l00482"></a>00482 {<a name="l00483"></a>00483 OCIInd ind = 0;<a name="l00484"></a>00484 OCIType *tdo = NULL;<a name="l00485"></a>00485 OCIRaw **value = NULL;<a name="l00486"></a>00486 <a name="l00487"></a>00487 res = OCI_ObjectGetAttr(obj, attr, (<span class="keywordtype">void</span> **) &value, &ind, &tdo);<a name="l00488"></a>00488 <a name="l00489"></a>00489 <span class="keywordflow">if</span> ((res == TRUE) && (value != NULL))<a name="l00490"></a>00490 { <a name="l00491"></a>00491 OCI_CALL2<a name="l00492"></a>00492 (<a name="l00493"></a>00493 res, obj-><a class="code" href="struct_o_c_i___object.html#8bde19100472fa2836e320e8e0878954">con</a>, <a name="l00494"></a>00494 <a name="l00495"></a>00495 OCIRawAllocSize(OCILib.env, obj-><a class="code" href="struct_o_c_i___object.html#8bde19100472fa2836e320e8e0878954">con</a>-><a class="code" href="struct_o_c_i___connection.html#573a359867139990b1b0f50aa7a86175">err</a>, *value, (ub4*) &raw_len)<a name="l00496"></a>00496 )<a name="l00497"></a>00497 <a name="l00498"></a>00498 <span class="keywordflow">if</span> (res == TRUE)<a name="l00499"></a>00499 {<a name="l00500"></a>00500 <span class="keywordflow">if</span> (len > raw_len)<a name="l00501"></a>00501 len = raw_len;<a name="l00502"></a>00502 <a name="l00503"></a>00503 memcpy(buffer, OCIRawPtr(OCILib.env, *value), len);<a name="l00504"></a>00504 }<a name="l00505"></a>00505 }<a name="l00506"></a>00506 }<a name="l00507"></a>00507 <a name="l00508"></a>00508 OCI_RESULT(res);<a name="l00509"></a>00509 <a name="l00510"></a>00510 <span class="keywordflow">return</span> len; <a name="l00511"></a>00511 }<a name="l00512"></a>00512 <a name="l00513"></a>00513 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00514"></a>00514 <span class="comment"> * OCI_ObjectGetDate</span><a name="l00515"></a>00515 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00516"></a>00516 <a name="l00517"></a><a class="code" href="group__g__usertypes.html#g482b6b2454951874790451be6bc810f7">00517</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="l00518"></a>00518 {<a name="l00519"></a>00519 <a class="code" href="struct_o_c_i___date.html" title="Oracle internal date representation.">OCI_Date</a> * date = NULL;<a name="l00520"></a>00520 <span class="keywordtype">boolean</span> res = FALSE;<a name="l00521"></a>00521 <span class="keywordtype">int</span> index = OCI_ObjectGetIndex(obj, attr, OCI_CDT_DATETIME);<a name="l00522"></a>00522 <a name="l00523"></a>00523 <span class="keywordflow">if</span> (index >= 0)<a name="l00524"></a>00524 {<a name="l00525"></a>00525 OCIInd ind = 0;<a name="l00526"></a>00526 OCIType *tdo = NULL;<a name="l00527"></a>00527 <a name="l00528"></a>00528 date = OCI_DateInit(obj-><a class="code" href="struct_o_c_i___object.html#8bde19100472fa2836e320e8e0878954">con</a>, (<a class="code" href="struct_o_c_i___date.html" title="Oracle internal date representation.">OCI_Date</a> **) &obj-><a class="code" href="struct_o_c_i___object.html#c200f98bde82ce8df32af3f17a453b20">objs</a>[index], <a name="l00529"></a>00529 NULL, FALSE, FALSE);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -