Page 1 of 1

Execute many SQL statements

Posted: Mon Apr 18, 2011 9:49 am
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.

Posted: Mon Apr 18, 2011 12:21 pm
by asorrell
Can you put the SQL statements in a stored procedure and use the stored procedure stage?

copy stage + connectors? Re: Execute many SQL statements

Posted: Mon Apr 18, 2011 12:34 pm
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