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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Nine 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!

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads