Four update SQLs in one DS job

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
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Four update SQLs in one DS job

Post by in_finity307 »

Hi,

I need to execute 4 update SQLs on the same table in SQL Server database in a DS job. I cannot put the 4 Update SQLS together in one ODBC Connector stage. I want the SQLS to execute one after the other because if the SQLs are fired simulatneously, then a deadlock of table occurs. If I use 4 different ODBC connector stages one for each SQL, then too the SQLS would get fired simulatneously and the table would get deadlocked. Can you suggest me a way to do this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, but what exactly do you mean by "4 update SQLs on the same table"?
-craig

"You can never have too many knives" -- Logan Nine Fingers
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Post by in_finity307 »

I mean that there are 4 conditional updates on the table. I can execute them on the database using the CASE statement, but ODBC connector does not accept the CASE synatx.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... again... based on conditions, you want to update different combinations of columns? Will you always execute all four or always just one of the four or something in-between?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Commit immedately (transaction size = 1) and keep your transaction isolation level to the minimum possible setting. Otherwise write all the updates to a staging area, and run another job to effect all the updates in a single run.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

You are on 8.x for windows. You should have a stage called SQL Server Enterprise stage. You might be able to use Case statement in that stage.

Any reason for not using that?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
DrPhys
Premium Member
Premium Member
Posts: 9
Joined: Wed Aug 27, 2008 2:14 pm

Post by DrPhys »

I agree with Ray's comments! In my onion it's best to push off the updates to subsequent jobs but there is also the option of using a DRS stage. This stage is very tricky but will allow you to perform multiple SQL statements from 1 stage... just a thought!
in_finity307
Participant
Posts: 20
Joined: Sat Aug 09, 2008 1:53 pm

Post by in_finity307 »

Thanks. I used the SQL Enterprise stage and the CASE statement worked fine in it.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

If the problem is resolved then please mark this post as Resolved using the big button on top of the page.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply