From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

Write Multiple Queries in toracleRow

Highlighted
Eight Stars

Write Multiple Queries in toracleRow

Hi All,

Hope everyone is doing well Smiley Happy. I am facing an issue.I am trying to integrate multiple sql queries of Oracle in 1 toracleRow. I have already setup my toracleconnection using allowMultiQueries=true. But when I am using Multiple Queries with ";" separated by them giving ora error of sql command not properly ended. Is there any way of writing multiple queries in one Row components

@rhall_2_0@TRF@vboppudi

 


Accepted Solutions
Highlighted
Eight Stars

Re: Write Multiple Queries in toracleRow

Hi @rhall_2_0,

I resolved the issue context to this Article

 

https://community.talend.com/t5/Migration-Configuration-and/Executing-multiple-SQL-statements-with-o.... Actually for DDL have to use execute immediate. Smiley Happy

View solution in original post


All Replies
Highlighted
Community Manager

Re: Write Multiple Queries in toracleRow

You need a Begin and and End in your SQL. Follow this....

http://djugal.blogspot.com/2013/03/talend-writing-multiple-sql-queries-in.html

Highlighted
Eight Stars

Re: Write Multiple Queries in toracleRow

Hi @rhall_2_0,

I was trying with your solution.But still getting sql command not properly ended. I have tested my Oracle Connection with allowMultiQueries=true. Is there any different WayOut richard?

Highlighted
Community Manager

Re: Write Multiple Queries in toracleRow

It might be easier to resolve if you paste your query :-)

Eight Stars

Re: Write Multiple Queries in toracleRow

Hi @rhall_2_0,

Just this One.

Create Table B as select * from A;

truncate Table tableA;

That's it Smiley Sad

 

Highlighted
Community Manager

Re: Write Multiple Queries in toracleRow

Try this.....

 

"BEGIN
Create Table B as select * from A;
truncate Table tableA;
END"
Highlighted
Eight Stars

Re: Write Multiple Queries in toracleRow

Hi @rhall_2_0,

I resolved the issue context to this Article

 

https://community.talend.com/t5/Migration-Configuration-and/Executing-multiple-SQL-statements-with-o.... Actually for DDL have to use execute immediate. Smiley Happy

View solution in original post

Highlighted
Four Stars

Re: Write Multiple Queries in toracleRow

Hi all,
I am using toraclerow component and writing multiple update statements.I want to get updated records counts.When I use NB_LINE_UPDATED after variable it is returning -1 but I need exact count of updated records.

Writing queries on below format:

BEGIN
UPDATE EMPLOYEE SET DATE=SYSDATE;
UPDATE SAL SET AMOUNT=10000;
END;

Someone help me on this.

Thanks in advance.

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog