Executing multiple SQL statements with one tOracleRow component

 Overview

Sometimes you need to execute multiple SQL statements using a single tOracleRow component, rather using mutltiple tOracleRow components to execute multiple SQL statements. This article explains how to execute multiple SQL statements on 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;

 

Icon

The above example only has 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 #:
1 of 1
Last update:
‎04-17-2017 08:05 PM
Updated by:
 
Labels (1)
Contributors