Page 1 of 1

Delete Rows from target table

Posted: Wed Sep 06, 2006 2:06 am
by hema177
Hi,

Is there any way in which rows which no longer exist in the Source tables can be deleted from the target tables using logic inherent to Datastage?

We are running server jobs on the Datastage Enterprise 7.5.1.A edition.

Thanks,

Posted: Wed Sep 06, 2006 2:10 am
by ArndW
Sure you can, it is quite easy. One easy way (but not necessarily the fastest for huge data volumes): Do a lookup from the target to the source; if the lookup is not successful then output to a stage which deletes those rows from the target.

Posted: Wed Sep 06, 2006 6:28 am
by hema177
ArndW wrote:Sure you can, it is quite easy. One easy way (but not necessarily the fastest for huge data volumes): Do a lookup from the target to the source; if the lookup is not successful then output to a stage which deletes those rows from the target.
Thanks for this... Will try this out.

Posted: Wed Sep 06, 2006 7:20 am
by keshav0307
You can use change capture stage.

Posted: Wed Sep 06, 2006 6:06 pm
by rasi
Change capture is in Enterprise.

Why not re-create the Target table instead of deleting. You can use bulk loader to load the target again.

Posted: Wed Sep 06, 2006 7:18 pm
by kumar_s
To find the records which are not in Source, you need to do a look, it can be either through Lookup Stage or Join stage as Arnd saind or recreate a table thorough a query INSERT INTO ....(SELECT ... FROM <target> IN(SELECT ... FROM <source>)) as suggested by Siva.

Posted: Mon Sep 11, 2006 5:21 am
by hema177
Hi All,

Thanks for all the suggestions, we have had to redesign all the maps to run in Enterprise, so we'll be using the Change Capture stage to deal with the deletes.

Cheers..