How to connect to two databases ? [message #419728] |
Tue, 25 August 2009 06:15 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
l_majid
Messages: 8 Registered: August 2009 Location: Paris
|
Junior Member |
|
|
Hello,
My program needs to connect to two databases and make operations in both databases:
Quote: | connect to db1;
connect to db2;
select from table in db1;
update table in db2;
|
i would like to know whether it's possible, and how to do it ? how to specify for each query the database connection to use?
please note that I can't use dblinks as i don't have enough access rights and privileges on neither of the databases.
thanks you for your replies.
|
|
|
|
Re: How to connect to two databases ? [message #419737 is a reply to message #419736] |
Tue, 25 August 2009 07:11 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
l_majid
Messages: 8 Registered: August 2009 Location: Paris
|
Junior Member |
|
|
thank you very much that worked ![Smile](images/smiley_icons/icon_smile.gif)
Quote: | EXEC SQL DECLARE XXXXX_DB DATABASE;
EXEC SQL CONNECT :user_id IDENTIFIED BY :password AT XXXXX_DB USING :db;
EXEC SQL AT XXXX_DB SELECT ......;
EXEC SQL AT XXXX_DB COMMIT;
|
vive le 92
|
|
|