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: 25036
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: 64103
Registered: March 2007
Location: Nanterre, France, http://...
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: 7880
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: Sun Dec 04 10:55:09 CST 2016

Total time taken to generate the page: 0.06353 seconds