If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Connect to different Oracle server and database in PL/SQL code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 4
Connect to different Oracle server and database in PL/SQL code

Hi,
There are two oracle servers and databese, A and B. I need to read data from database A and insert those data to databse B. Is there anyway I can do it in PL/SQL program?

Regards,

Shiva
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,613
>Is there anyway I can do it in PL/SQL
use a DBLINK (database link)
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 4
Thanks. But wehen I run a query,
Select * from [tablename]@TEST
I receive following error,
"ORA-02019: Connection description for remore database not found".
Would you please advise?
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,613
>Would you please advise?
before you can use a DBLINK, you must CREATE DBLINK ......
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Don't say, show. Don't promise, prove.
Reply With Quote
  #5 (permalink)  
Old
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 4,003
And before you create a database link, you must read how to do it.
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Nov 2003
Posts: 2,807
Quote:
Originally Posted by Shiva.jamshidiat
Select * from [tablename]@TEST
[tablename] is not a valid identifier in Oracle.
I hope you don't really use those square brackets...
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 4
Thanks all. I created a DBLINK and get the result.
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 4
Thanks all. I didn't user table name in bracket, Just I created a DBLINK and get the result.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On