Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I check whether I'm connected to a database?

Status
Not open for further replies.
Jan 21, 2002
8
0
0
US
Hi all!

I have an application where I CONNECT to a database if it's found on the system. Is there a way to check whether I'm connected prior to performing a DISCONNECT?

Thanks for the assistance!

Chris Proctor
Gart Sports
Denver
 

select count(*) into li_test from dual ;

Check sqlca.sqlcode , if it's not equal 0 , Means connection is wrong .

 
I don't quite understand your answer.... I am connected to up to 4 databases at once. I have to be able to check each of them individually. Does your answer to my question handle this? If so, how?
Could you explain what "select count(*) into li_test from dual ;" does?

Thanks for your reply.
 
THen U must use 4 SQLCA , So you should check sqlcode for each one , because it's the only indicator . Best regards
LiGang
U get , U given ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top