Delete rows before inserting

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
guysma
Participant
Posts: 32
Joined: Wed Sep 14, 2005 2:15 am
Location: ISRAEL

Delete rows before inserting

Post by guysma »

Hi, I'm looking for a way to delete all the rows of a certain DB2 table,
And then insert new rows from a flat file. all this only in DS and not in the JCL by loading a dummy file before
Any ideas?
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

You can do by selecting the option "Clear the table and then Insert rows" in DB2 stage
guysma
Participant
Posts: 32
Joined: Wed Sep 14, 2005 2:15 am
Location: ISRAEL

Post by guysma »

MOHAMMAD.ISSAQ wrote:You can do by selecting the option "Clear the table and then Insert rows" in DB2 stage
this option does not exist in the mvs edition
the only option near to it is replace exsisting rows completly , but this option delete the table for each row again and again
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

Hi I don't know about the MVS edition, but check for "open command" property and if it is available, you can put the table truncate command there. This open command will be processed before the row level transactions are made.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"Replace existing rows completely" performs a DELETE then an INSERT on each row processed. It does not clear the table.

In MVS edition you don't really have an alternative, unless you want to create a routine to delete all rows from the table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply