XML inrespect to Database Update action

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
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

XML inrespect to Database Update action

Post by g_rkrish »

Hi All,

I have kind of XML questions with database..here is the scenario..I have XML...where Project is at higher level..in which i have sub nodes like tracking,companies etc..i can have multiple company for project etc..how i have to do my updates in my table is that...if a record that need to be updated with earlier one..i should remove the earlier one and insert the one that is coming one now..so it should delete all the company all the companies tracking list earlier and insert the new one...when i do that what it does was it just put last company for the project instead of putting all..i.e i gave update action as replace the existing rows completely...as ds works one by one record.....is any way to delete all the all the project related record and insert the new project information.......which might be correct update action..

Thanks,
RK
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: XML inrespect to Database Update action

Post by kris »

You have to design the job in such a way that your delete statement executes first and then you process your insert statement.

You have to introduce this conditional processing step between deletes and inserts. You can write the record (insert) to a hashed file and process deletes in the database stage and then read this record from hashed file and prosess inserts in another database stage.

If necessary you can add a dummy database read (from dual) in the process right after your deletes to make sure your next process(insert) starts right after deletes.

Hope this helps.
~Kris
Post Reply