Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re:Checking if Oracle Connection still valid
Yusron,
One item I have noted from those who love OCI is that they rarely if ever include the sqlca.h file which defines a structure called sqlca (wonder where that name came from). This is regrettable since it works with OCI just as well as Pro*C. There is a data point in sqlca called sqlca.sqlerrm which under normal circumstances is set to 0 by Oracle on the completion of every call. Now if your session is no longer valid you'll find it set to -1012 in which case you need to reconnect to the database.
Dick Goulet
BTW: One other kind of an irk in the side I have with OCI programs that do not include sqlca.h is that when they want to retrieve a pile of data they go and count all of the rows that fulfill the where clause so as to know when they have fetched all of the data. Well instead you can fetch a row of data and then check sqlca.sqlerrm. If it's > 0 then you've gotten all of the data there is.
____________________Reply Separator____________________ Author: "Yusron Hilmy" <yusron_at_ebdesk.com> Date: 8/14/2001 9:20 PM
Hi All,
I am using OCI to build my oracle application. In OCI, how I can check if oracle connection/session is still valid ? like dbdead() in MSSQL.
Thanks,
Yusron
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Yusron Hilmy
INET: yusron_at_ebdesk.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Aug 15 2001 - 10:07:20 CDT