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

📄 timestamp_8c-source.html

📁 oci的源码,可以在任何平台上编译,相当方便实用
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00136"></a>00136     OCI_CHECK_TIMESTAMP_ENABLED(con, NULL);<a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00139"></a>00139 <span class="preprocessor"></span><a name="l00140"></a>00140     tmsp = OCI_TimestampInit(con, &amp;tmsp, NULL, type);<a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="preprocessor">#else</span><a name="l00143"></a>00143 <span class="preprocessor"></span><a name="l00144"></a>00144     OCI_NOT_USED(type);<a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="preprocessor">#endif</span><a name="l00147"></a>00147 <span class="preprocessor"></span><a name="l00148"></a>00148     OCI_RESULT(tmsp != NULL);<a name="l00149"></a>00149 <a name="l00150"></a>00150     <span class="keywordflow">return</span> tmsp;<a name="l00151"></a>00151 }<a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00154"></a>00154 <span class="comment"> * OCI_TimestampFree</span><a name="l00155"></a>00155 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00156"></a>00156 <a name="l00157"></a><a class="code" href="group__g__timestamp.html#g60e9851db1175d6b650f9df00db274da">00157</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__timestamp.html#g60e9851db1175d6b650f9df00db274da" title="Free an OCI_Timestamp handle.">OCI_TimestampFree</a>(<a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp)<a name="l00158"></a>00158 {<a name="l00159"></a>00159     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp, FALSE);<a name="l00160"></a>00160     <a name="l00161"></a>00161     OCI_CHECK_TIMESTAMP_ENABLED(tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>, FALSE);<a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00164"></a>00164 <span class="preprocessor"></span><a name="l00165"></a>00165     OCI_CHECK_OBJECT_FETCHED(tmsp, FALSE);<a name="l00166"></a>00166 <a name="l00167"></a>00167     <span class="keywordflow">if</span> (tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8ff4e6c21d3682581e93c36e9abc9b39">hstate</a> == OCI_OBJECT_ALLOCATED)<a name="l00168"></a>00168     {<a name="l00169"></a>00169         ub4 htype  = 0;<a name="l00170"></a>00170 <a name="l00171"></a>00171         <span class="keywordflow">if</span> (tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#c650d324d802e3484654ec52df509ff5">type</a> == OCI_TIMESTAMP)<a name="l00172"></a>00172             htype = OCI_DTYPE_TIMESTAMP;<a name="l00173"></a>00173         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#c650d324d802e3484654ec52df509ff5">type</a> == OCI_TIMESTAMP_TZ)<a name="l00174"></a>00174             htype = OCI_DTYPE_TIMESTAMP_TZ;<a name="l00175"></a>00175         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#c650d324d802e3484654ec52df509ff5">type</a> == OCI_TIMESTAMP_LTZ)<a name="l00176"></a>00176             htype = OCI_DTYPE_TIMESTAMP_LTZ;<a name="l00177"></a>00177 <a name="l00178"></a>00178        OCI_DescriptorFree((dvoid *) tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>, htype);<a name="l00179"></a>00179     }<a name="l00180"></a>00180 <a name="l00181"></a>00181     OCI_FREE(tmsp);<a name="l00182"></a>00182    <a name="l00183"></a>00183 <span class="preprocessor">#endif</span><a name="l00184"></a>00184 <span class="preprocessor"></span>   <a name="l00185"></a>00185    OCI_RESULT(TRUE);<a name="l00186"></a>00186 <a name="l00187"></a>00187    <span class="keywordflow">return</span> TRUE;<a name="l00188"></a>00188 }<a name="l00189"></a>00189 <a name="l00190"></a>00190 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00191"></a>00191 <span class="comment"> * OCI_TimestampGetType</span><a name="l00192"></a>00192 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00193"></a>00193 <a name="l00194"></a><a class="code" href="group__g__timestamp.html#ga6a59f18f308bd55841654bd66c6cee6">00194</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__timestamp.html#ga6a59f18f308bd55841654bd66c6cee6" title="Return the type of the given Timestamp object.">OCI_TimestampGetType</a>(<a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp)<a name="l00195"></a>00195 {<a name="l00196"></a>00196     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp, OCI_UNKNOWN);<a name="l00197"></a>00197 <a name="l00198"></a>00198     OCI_CHECK_TIMESTAMP_ENABLED(tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>, OCI_UNKNOWN);<a name="l00199"></a>00199 <a name="l00200"></a>00200     OCI_RESULT(TRUE);<a name="l00201"></a>00201 <a name="l00202"></a>00202     <span class="keywordflow">return</span> tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#c650d324d802e3484654ec52df509ff5">type</a>;<a name="l00203"></a>00203 }<a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00206"></a>00206 <span class="comment"> * OCI_DateZoneToZone</span><a name="l00207"></a>00207 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00208"></a>00208 <a name="l00209"></a><a class="code" href="group__g__timestamp.html#g6b8356c2fcaa984d2d63edd5cc7a357b">00209</a> <span class="keywordtype">boolean</span> OCI_API <a class="code" href="group__g__timestamp.html#g6b8356c2fcaa984d2d63edd5cc7a357b" title="Assign the value of a timestamp handle to another one.">OCI_TimestampAssign</a>(<a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp, <a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp_src)<a name="l00210"></a>00210 {<a name="l00211"></a>00211     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00212"></a>00212 <a name="l00213"></a>00213     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp,     FALSE);<a name="l00214"></a>00214     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp_src, FALSE);<a name="l00215"></a>00215 <a name="l00216"></a>00216     OCI_CHECK_TIMESTAMP_ENABLED(tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>, FALSE);<a name="l00217"></a>00217 <a name="l00218"></a>00218 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00219"></a>00219 <span class="preprocessor"></span><a name="l00220"></a>00220     OCI_CALL4<a name="l00221"></a>00221     (<a name="l00222"></a>00222         res, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>,<a name="l00223"></a>00223         <a name="l00224"></a>00224         OCIDateTimeAssign((dvoid *) OCILib.env, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>,<a name="l00225"></a>00225                           tmsp_src-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>)<a name="l00226"></a>00226     )<a name="l00227"></a>00227 <a name="l00228"></a>00228 <span class="preprocessor">#endif</span><a name="l00229"></a>00229 <span class="preprocessor"></span><a name="l00230"></a>00230    OCI_RESULT(res);<a name="l00231"></a>00231 <a name="l00232"></a>00232    <span class="keywordflow">return</span> res;<a name="l00233"></a>00233 }<a name="l00234"></a>00234 <a name="l00235"></a>00235 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00236"></a>00236 <span class="comment"> * OCI_TimestampCheck</span><a name="l00237"></a>00237 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00238"></a>00238 <a name="l00239"></a><a class="code" href="group__g__timestamp.html#gb23aaba98e752b92725045205bd55a03">00239</a> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__timestamp.html#gb23aaba98e752b92725045205bd55a03" title="Check if the given timestamp is valid.">OCI_TimestampCheck</a>(<a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp)<a name="l00240"></a>00240 {<a name="l00241"></a>00241     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00242"></a>00242     ub4 value   = 0;<a name="l00243"></a>00243 <a name="l00244"></a>00244     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp, value);<a name="l00245"></a>00245 <a name="l00246"></a>00246     OCI_CHECK_TIMESTAMP_ENABLED(tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>, value);<a name="l00247"></a>00247 <a name="l00248"></a>00248 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00249"></a>00249 <span class="preprocessor"></span><a name="l00250"></a>00250     OCI_CALL4<a name="l00251"></a>00251     (<a name="l00252"></a>00252         res, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>,<a name="l00253"></a>00253         <a name="l00254"></a>00254         OCIDateTimeCheck((dvoid *) OCILib.env, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>, &amp;value)<a name="l00255"></a>00255     )<a name="l00256"></a>00256 <a name="l00257"></a>00257 <span class="preprocessor">#endif</span><a name="l00258"></a>00258 <span class="preprocessor"></span> <a name="l00259"></a>00259     OCI_RESULT(res);<a name="l00260"></a>00260 <a name="l00261"></a>00261     <span class="keywordflow">return</span> (<span class="keywordtype">int</span>) value;<a name="l00262"></a>00262 }<a name="l00263"></a>00263 <a name="l00264"></a>00264 <span class="comment">/* ------------------------------------------------------------------------ *</span><a name="l00265"></a>00265 <span class="comment"> * OCI_TimestampCompare</span><a name="l00266"></a>00266 <span class="comment"> * ------------------------------------------------------------------------ */</span><a name="l00267"></a>00267 <a name="l00268"></a><a class="code" href="group__g__timestamp.html#g8063cc410dc2ed2a80aa9a434e759b0b">00268</a> <span class="keywordtype">int</span> OCI_API <a class="code" href="group__g__timestamp.html#g8063cc410dc2ed2a80aa9a434e759b0b" title="Compares two timestamp handles.">OCI_TimestampCompare</a>(<a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp, <a class="code" href="struct_o_c_i___timestamp.html" title="Oracle internal timestamp representation.">OCI_Timestamp</a> *tmsp2)<a name="l00269"></a>00269 {<a name="l00270"></a>00270     <span class="keywordtype">boolean</span> res = TRUE;<a name="l00271"></a>00271     sword value = OCI_ERROR;<a name="l00272"></a>00272 <a name="l00273"></a>00273     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp,  value);<a name="l00274"></a>00274     OCI_CHECK_PTR(OCI_IPC_TIMESTAMP, tmsp2, value);<a name="l00275"></a>00275 <a name="l00276"></a>00276     OCI_CHECK_TIMESTAMP_ENABLED(tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>, FALSE);<a name="l00277"></a>00277 <a name="l00278"></a>00278 <span class="preprocessor">#if OCI_VERSION_COMPILE &gt;= OCI_9</span><a name="l00279"></a>00279 <span class="preprocessor"></span><a name="l00280"></a>00280     OCI_CALL4<a name="l00281"></a>00281     (<a name="l00282"></a>00282         res, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#8d58d5aabe4cf9100bfdfc8428fbc234">con</a>,<a name="l00283"></a>00283         <a name="l00284"></a>00284         OCIDateTimeCompare((dvoid *) OCILib.env, tmsp-&gt;<a class="code" href="struct_o_c_i___timestamp.html#a63a28fecaeb556596429ac636329b22">err</a>,<a name="l00285"></a>00285                             tmsp2-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>, tmsp2-&gt;<a class="code" href="struct_o_c_i___timestamp.html#fc374755147e6be3141d875fdad3cf8a">handle</a>, &amp;value)

⌨️ 快捷键说明

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