Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
abhi90
Creator II
Creator II

Write Multiple Queries in toracleRow

Hi All,

Hope everyone is doing well 0683p000009MACn.png. 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@TRF@vboppudi

 

Labels (2)
1 Solution

Accepted Solutions
abhi90
Creator II
Creator II
Author

Hi @Richard Hall​,

 

I resolved the issue context to this Article

 

https://community.talend.com/s/article/Executing-multiple-SQL-statements-with-one-tOracleRow-component-G7XJq

 

Actually for DDL have to use execute immediate.

😉

View solution in original post

10 Replies
Anonymous
Not applicable

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

abhi90
Creator II
Creator II
Author

Hi @rhall,

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?

Anonymous
Not applicable

It might be easier to resolve if you paste your query 🙂

abhi90
Creator II
Creator II
Author

Hi @rhall,

Just this One.

Create Table B as select * from A;

truncate Table tableA;

That's it 0683p000009MPcz.png

 

Anonymous
Not applicable

Try this.....

 

"BEGIN
Create Table B as select * from A;
truncate Table tableA;
END"
abhi90
Creator II
Creator II
Author

Hi @Richard Hall​,

 

I resolved the issue context to this Article

 

https://community.talend.com/s/article/Executing-multiple-SQL-statements-with-one-tOracleRow-component-G7XJq

 

Actually for DDL have to use execute immediate.

😉

Anonymous
Not applicable

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.
kotvir
Contributor
Contributor

Page is not working.

 

Also, I am trying to re-create sequence by Drop and Craete sequence statements, but its not working with BEGIN and END.

 

"BEGIN

DROP SEQUENCE SEQ1;

CREATE SEQUENCE SEQ1 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;

END"

 

Any thoughts ?

Anonymous
Not applicable

Hi @Viral Kothari​,

 

Thanks for raising the broken link issue. We had to dynamically modify quite a bit of HTML when we migrated all of the posts from our old Community application to this new application. Some of the links got missed. I have corrected this one, so hopefully it will be of more use to you now.

 

Regards

 

Richard