How to handle no rows retrieved from Mysql DB

Highlighted
Six Stars

How to handle no rows retrieved from Mysql DB

Hi All,

 

How can I give different response when rows found and when zero rows found. below is my job.

 

Capture.PNG

 

I am able to get a response, but how can we respond when there are no rows.

 

Thanks. 

 

 

Employee

Re: How to handle no rows retrieved from Mysql DB

Hi,

 

    Could you please check using the parameters shown in the screenshot?

image.png

 

Please note that this value will be available after the operation. So you will have to split your operation to two subjobs. The first subjob should end with DBOutput Insert.

 

In the second subjob, you can use a tJava or Runif or similar component to check the condition and send the necessary response.

 

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

Six Stars

Re: How to handle no rows retrieved from Mysql DB

This helps when there is a DML opperation, Can you a help me also on querying the records, I may or maynot get resultset.

How can I supply two different response on such situation.

Appreciate your help.

Thanks,
Employee

Re: How to handle no rows retrieved from Mysql DB

Hi,

 

    For query operation, why don't you replicate your output result set to two operations using tReplicate Command? The first flow can be used to do aggregation (using tAggregateRow) where you can count the number of records passed from DB. The second flow will have original records.

 

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

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

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now