Home » SQL & PL/SQL » SQL & PL/SQL » Insert data over network. (10.2g)
Insert data over network. [message #379019] Sun, 04 January 2009 00:21 Go to next message
Bangla
Messages: 49
Registered: August 2008
Member
I need to insert data from a table in one database to another over network link. It is like 20,000 rows. If a row is successfully inserted over the network link then in the table there is a flag in the source table. That flag will be set.

How to do it?
Re: Insert data over network. [message #379020 is a reply to message #379019] Sun, 04 January 2009 00:24 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>How to do it?
UPDATE statement; of course
Re: Insert data over network. [message #379023 is a reply to message #379019] Sun, 04 January 2009 00:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
From target db:
begin
  insert into target select * from source@db_link where ...;
  update source@db_link set flag=1 where ...;
end;

Or from source db:
begin
  insert into target@db_link select * from source where ...;
  update source set flag=1 where ...;
end;

Regards
Michel
Re: Insert data over network. [message #379026 is a reply to message #379019] Sun, 04 January 2009 00:58 Go to previous messageGo to next message
Bangla
Messages: 49
Registered: August 2008
Member
Thank you.
Re: Insert data over network. [message #379035 is a reply to message #379026] Sun, 04 January 2009 02:54 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Maybe this is obvious to you: do NOT commit in between. Only commit after ALL your work is done.
Previous Topic: Need a query...!!!!
Next Topic: nested tables
Goto Forum:
  


Current Time: Sat Feb 08 20:51:36 CST 2025