Home » SQL & PL/SQL » SQL & PL/SQL » Select from a remote database...
Select from a remote database... [message #2643] Fri, 02 August 2002 09:51 Go to next message
Oscar
Messages: 6
Registered: November 2001
Junior Member
I need to insert data from one table in a Database to another Database in a Stored Procedure, without export and import.
Does someone have a script to do this??
Re: Select from a remote database... [message #2669 is a reply to message #2643] Mon, 05 August 2002 14:31 Go to previous messageGo to next message
Silpa
Messages: 23
Registered: July 2002
Junior Member
Create a Database Link to your remote database in your
local database and use it in your queries and insert it.

If your remote dabasename is rdb1

CREATE DATABASE LINK rdb1_link
CONNECT TO 'user1' identified by 'password'
USING 'service_name';

Then in your local database

insert into table1
select * from table2@rdb1_link;
Re: Select from a remote database... [message #2689 is a reply to message #2643] Tue, 06 August 2002 11:23 Go to previous message
ram
Messages: 95
Registered: November 2000
Member
d1 is one database user scott where table is there..
select * from golbal_name ; do this on d1 databse
the baove slect statement gave ram.mpl as oupt put assume
god to d2 databse
create public database link
ram.mpl connect to SCOTT identified by
tiger using 'dev1' ;
here dev1 is connect string..
ram.mpl u know how we got it
imp......
always link name in d2 databse should be same as select * from golbal_name out put on d1 databse;

create table x as select * from tablename@d2tod1; on d2 databse
now u can create any tbale in scott user by using above statment..
for this to work global_names=true
R U CAN DO
ALTER SESSION SET GLOBAL_NAMES=FASLE;
THEN WE CAN GIVE ANY NAME TO LINE
IMMETERIAL TO SELECT * FROM GLOBAL_NAME;
Previous Topic: Re: Error while exporting
Next Topic: Retrieving Multiple OUT Parameter Rows
Goto Forum:
  


Current Time: Thu Apr 25 09:30:31 CDT 2024