Home » Developer & Programmer » Precompilers, OCI & OCCI » Database Links (Oracle 10g, Windows)
Database Links [message #305540] Tue, 11 March 2008 04:15 Go to next message
salman83
Messages: 2
Registered: March 2008
Junior Member
Hi all,
I am newbie to OCI. I am stuck into a problem related to database links in OCI. On my two separate machines, I have oracle installed (both of them 10g). I want to insert data into table which resides on database #1. The data will be get from another table which resides on database #2.
I do not know how to do it. I want to do it using OCI only. Kindly help me out!!!.

Thank you.
Re: Database Links [message #305550 is a reply to message #305540] Tue, 11 March 2008 04:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can do it like if it is a local table, it does not matter the source is local or remote just use the database link inside the "insert select" statement.

Regards
Michel
Re: Database Links [message #305559 is a reply to message #305540] Tue, 11 March 2008 04:59 Go to previous messageGo to next message
salman83
Messages: 2
Registered: March 2008
Junior Member
Thanks Micheal for your reply.

One more question, this means that I do not have to make connection explicitly for Database #2.

Thank you.
Re: Database Links [message #305581 is a reply to message #305559] Tue, 11 March 2008 05:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, database link makes the connection for you behind the scene. You don't have to care about it.

Regards
Michel
Re: Database Links [message #305583 is a reply to message #305559] Tue, 11 March 2008 05:38 Go to previous message
vicenzo
Messages: 28
Registered: December 2007
Location: Paris
Junior Member
when using database links, the connection to the remote server is implicit and done on the fly when you first reference it in a query
Previous Topic: OCILogon failing at one of my sites.
Next Topic: PRO*C
Goto Forum:
  


Current Time: Thu Mar 28 17:54:21 CDT 2024