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.
This procedure was written with:
Talend verified this procedure to be compatible with:
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;
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;