Page 1 of 1

delete records from table

Posted: Tue Feb 21, 2006 4:56 pm
by rcil
Hello All,

Apologies if this topic is covered earlier. I searched for the answers before posting but didn't find any. I want to know how we delete the records from the table using datastage job. I mean I have a table I want to delete some data based on some of the filter conditions. Source and target is the same table. I know it can be easily achieved using the shell script but I want to know how it is possible in datastage.

Thanks for all the inputs

-RCil

Posted: Tue Feb 21, 2006 5:39 pm
by ray.wurlod
You can use user-defined SQL; you job must provide values for the key columns that identify the rows to be deleted, and you include a parameter marker for each in the WHERE clause of your SQL. Make sure that the SELECT operation is complete before you perform any DELETE, otherwise you might introduce a deadlock in the database.

Posted: Tue Feb 21, 2006 5:44 pm
by chulett
Or depending on the database / stage used, you may have an 'Update Action' of 'Delete existing rows only' that you can stream key field values into.