Home » Developer & Programmer » Precompilers, OCI & OCCI » How to connect to a 2nd database in Pro*C
How to connect to a 2nd database in Pro*C [message #94220] Fri, 21 May 2004 04:26 Go to next message
Ramesh R
Messages: 2
Registered: May 2004
Junior Member
Hi

 

How do I connect to a 2nd database in Pro*C and run SQL statments when I'm already connected to an instance.

 

Regards

Ramesh
Re: How to connect to a 2nd database in Pro*C [message #94222 is a reply to message #94220] Sun, 23 May 2004 11:07 Go to previous messageGo to next message
Dheeraj Anand
Messages: 5
Registered: May 2004
Junior Member
Hi,

Here is the way: -

EXEC SQL DECLARE DB_NAME1 DATABASE;
EXEC SQL DECLARE DB_NAME2 DATABASE;

EXEC SQL CONNECT :username IDENTIFIED BY :password AT DB_NAME1 USING :db_string1;

EXEC SQL CONNECT :username IDENTIFIED BY :password AT DB_NAME2 USING :db_string2;

Usage: -

EXEC SQL AT DB_NAME1 select * from test1'
EXEC SQL AT DB_NAME2 select * from test2'

Dheeraj
Re: How to connect to a database with c [message #94497 is a reply to message #94220] Wed, 22 December 2004 07:01 Go to previous messageGo to next message
Fotis
Messages: 1
Registered: December 2004
Junior Member
How can i connect c to a database?
Re: How to connect to a database with c [message #94546 is a reply to message #94497] Sun, 23 January 2005 21:03 Go to previous message
Javkhlan
Messages: 1
Registered: January 2005
Junior Member
i'm mongolian Computer Science and Managent School's studen please help me how can i connect database to cc++?
Previous Topic: pro*c connectivity with oracle
Next Topic: OCILogon and OS level authentication
Goto Forum:
  


Current Time: Thu Mar 28 08:39:00 CDT 2024