Executing multiple SQL statements with one tOracleRow component

Overview

Sometimes you need to execute multiple SQL statements using a single tOracleRow component, rather using multiple tOracleRow components to execute multiple SQL statements. This article explains how to execute multiple SQL statements in a single tOracleRow component.

 

Environment

This procedure was written with:

  • Talend Open Studio for DI 5.0-r72978
  • JDK version: Sun JDK build 1.6.0_26-b03
  • Operating system: Windows XP SP3

Talend verified this procedure to be compatible with:

  • Data Integration releases: 4.2.3, 4.2.4, 5.0.0, 5.0.1, 5.0.2, 5.1.1, 5.1.2, 5.2.0

 

Procedure

You can execute multiple statements with one tOracleRow component as follows:

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;

1_027.png

 

The above example has only DML statements. If the group of SQL statements contains DDL statements, you must use the EXECUTE IMMEDIATE command followed by the DDL statement. For example:

begin
update table1 set name='Shong' where id=2;
execute immediate 'drop table t3';
commit;
end;
Version history
Revision #:
6 of 6
Last update:
‎04-04-2019 03:28 AM
Updated by:
 
Labels (2)
Comments
Four Stars

How to execute "Multiple Select Statements" having same output format ?

Moderator

Hello @sreeram_mandem ,

Are you looking for tflowtoiterate component to achieve your goal? We saw your another topic here:https://community.talend.com/t5/Design-and-Development/Oracle-Multiple-Select-Statements-execution-u...

Best regards

Sabrina

Four Stars

hi @xdshi 

 

Yes I'm looking for detailed solution where as it's not available 

 

Coming to this post looking for help on the solutioning part

 

Thanks

Sreeram