delete records from table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rcil
Charter Member
Charter Member
Posts: 70
Joined: Sat Jun 05, 2004 1:37 am

delete records from table

Post 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
Thanks,
RCil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply