Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2005

Tip: Looking for answers? Try searching our database.

Archiving data from 2 db2 tables...........

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alias - 22 Mar 2005 17:44 GMT
Hi Guys ,
         I am still new to the db2 world so pls help me with the
following :

I have 2 tables A & B in different databases . They can be joined on a
customer_number column. I have to archive all the data from A which is
more then 30 days old in a seprate table ( say arch_a) . For all the
archived data from A , I also have to archive related data from B in a
separate table( say arch_B) (again joined by customer  number) and once
the data has been inserted in both the archived tables, It must be
deleted from the original tables(a and B).

Had it been oracle , I would have used a cursor to process the data
from A and then for each record from A , the related record from B . I
also would have used a db link to access B as its in another database.
But how could I achive the same thing in DB2 ?  My challneges are :

1. How to access table B along with A as they are in different
databases ( I guess I may have to use Fedarated database)

2. How to process 30 day old data from A and then for each record
related data from B and then archive them into archived tables and in
the end delete them from the source ? ( Does db2 have cursor
functionality ? Any place where I can see examples )

3. Also how can i ensure that the archive process completes in its
entirity maintaining consistency? If there is any problem during
process , everything should rollback .(

Sorry for a long description.

Pls help.

Thanks.
Anton Versteeg - 23 Mar 2005 11:28 GMT
In DB2 this is called Distributed Unit of Work (DUOW) or Multisite update.
Supported is the two-phase-commit protocol.
If you search on these terms in the admin guide - programming client apps
(DB2 UDB V8) you will find instructions on how to do the above.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.