Execute many SQL statements

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
le thuong
Premium Member
Premium Member
Posts: 76
Joined: Wed Sep 09, 2009 5:21 am

Execute many SQL statements

Post by le thuong »

I have the following business requirement when migrating a DTS package to Datastage. In DTS, some "Execute SQL Task" contain many SQL statements. I have tested an Open command with DB2/UDB Enterprise: it accepts 1 SQL statement, not many SQL statements (I tried to separate with spaces, with ; ).
I also tried an Execute command activity, to execute the SQL statements (2 insert statements) written in a text file, but the job sequence keeps running forever. Is it a syntax problem ?

Thanks for any suggestion.
Thuong

best regards
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Can you put the SQL statements in a stored procedure and use the stored procedure stage?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
jgreve
Premium Member
Premium Member
Posts: 107
Joined: Mon Sep 25, 2006 4:25 pm

copy stage + connectors? Re: Execute many SQL statements

Post by jgreve »

If the statements don't need to be ordered, you could use a copy stage to feed the same data to multiple db-connectors: e.g. 1 statement per connector.

By the way, how many sql statements is "many"? 10? 500? 1,000? More?

And what kinds of statements... Lots of insert statements? Or conditional insert/update/delete logic?

And how long will this logic need to be used & maintained?

andy's idea is cleaner, but for a quick & dirty one-time migration maybe that isn't so bad.
John
Post Reply