How to execute multiple queries in one tSybaseRow component?

Four Stars

How to execute multiple queries in one tSybaseRow component?

I have multiple SQL statements(both DDL and DML) of Sybase db. And I need to execute them in one tSybaseRow component. I tried with "allowMultiQueries=true" in the additional JDBC parameters section but it is not working. It's throwing error "Incorrect syntax near ';'" (The queries are separated by ';').

I have attached the screenshot of the tSybaseRow component. As of now, I am trying with only DML statements.

Please suggest solutions.. Thanks!

Employee

Re: How to execute multiple queries in one tSybaseRow component?

Hi,

 

    Since you are using same DB connection, you can create two tSybaserow components for each insert statements and connect them by OnSubjobOK. Once both are successful, you can use tSybaseCommit else you can use tSybaseRollback.

 

    In this way, you will get the same results. 

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Highlighted
Four Stars

Re: How to execute multiple queries in one tSybaseRow component?

Hi Nikhil,
Thanks for your response!
Actually I have many SQL queries (Almost 200+) and to execute each query, I have to use those many tSybaseRow conponents. Also I can't use Stored Procedure (As directed by my lead). So, is there any way in which I can execute multiple queries in one single sybase component? Because executing multiple queries is possible in Oracle or MySQL components using "allowMultiQueries=true" as additional JDBC parameter.

Thanks!
Employee

Re: How to execute multiple queries in one tSybaseRow component?

Hi,

 

    Could you please raise this issue as a JIRA ticket for this specific component?

 

https://jira.talendforge.org

 

    Product team can then validate the issue and can help you with some patch if it is something missing from the current component setup.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Eleven Stars

Re: How to execute multiple queries in one tSybaseRow component?

Try using tFlowToIterate  and iterate tSybaseRow for each update statement.

 

Hope this will help as workaround

Regards
Abhishek KUMAR
Four Stars

Re: How to execute multiple queries in one tSybaseRow component?

Hi akuma,

 

Thanks for your response. This workaround looks good but what if I have to use the value of context variable in the query, then how to write the query in the file. Eg.: "Update Employee
set emp_name="+context.name+" where emp_id=1";

 

This query is not working when I am putting it in a file but it is working when I am putting it in the tSybaseRow component.

Please suggest.

 

Thanks!

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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog