Set preloaded statement in target 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
ylai20
Participant
Posts: 15
Joined: Tue Jun 08, 2010 10:12 pm

Set preloaded statement in target table?

Post by ylai20 »

I want to load data into a target table that it has time_key (yyyymm).
I may reload data few time to this table. For second time reload, i need to delete the data which belong to the same time_key to avoid duplicated record.

Currently what i am doing is i create a job
Seq file > Transformation > odbc (in enter sql > delete from xxx where time_key=201011), something like workaround.

Is the any better way to set the delete statement in target table before the real data is load into the table?

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use an Open command in the "real data" job to delete the records (if any).
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 »

Two ODBC links, one for the delete and one for the inserts. Make sure only the first row goes to the delete link before it goes to the insert link.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ylai20
Participant
Posts: 15
Joined: Tue Jun 08, 2010 10:12 pm

Post by ylai20 »

chulett wrote:Two ODBC links, one for the delete and one for the inserts. Make sure only the first row goes to the delete link before it goes to the insert link. ...
Sorry, you mean ODBC --> Transformation --> ODBC (delete) --> ODBC (Insert)?
Post Reply