Multiple SQL statements using tdb2row

Multiple SQL statements using tdb2row

Hi,

I want to run multiple sql using tdb2row on db2 but its not working. I am also using same with tteradatarow on teradata db with multiple sqls and its running fine.

sql:

"DELETE FROM TABLE1;
DELETE FROM TABLE2;
DELETE FROM TABLE3;
.
.
.
.
.
DELETE FROM TABLEn;"


Regards
Asif
One Star

Re: Multiple SQL statements using tdb2row

Hi,

Multiple statements in one component is not supported by Talend a.f.a.i.k.

You should probably use some iteration component (tForEach for example) to accomplish this. You might even use a query to select all (required) table names from your database and iterate of this result set using a tFlowToIterate.

Hope this helps.

Regards,
Arno
One Star

Re: Multiple SQL statements using tdb2row

Hi Asif

I'm not sure but you may try it as seen bellow.
"begin
update table1 set name='Shong' where id=2;
update table1 set name='Patrick' where id=3;
delete from table1 where id=4;
commit;
end;"

Wait for your feedback.

Regards,
Pedro

Re: Multiple SQL statements using tdb2row

Pedro,

Where should place this code ?

Regards
Asif
One Star

Re: Multiple SQL statements using tdb2row

Hi Asif

Type this code in 'Query' text field on tDB2Row.

Regards,
Pedro
One Star

Re: Multiple SQL statements using tdb2row

Pedro
I'm trying to do same, I want to drop a nickname and create a nickname using tDB2Row. Placing inside begin end block does not work. Is there any other way? 

Asif 
Did you resolve it ? Are you able to run multiple sql statements in db2 using tDB2Row component? Can you please advice on how you resolved it. 

Thanks
Ruby

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog