Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pravinm
Contributor III
Contributor III

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.

 

0683p000009M7RY.png

 

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

 

Thanks. 

 

 

Labels (4)
3 Replies
Anonymous
Not applicable

Hi,

 

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

0683p000009M7QM.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

pravinm
Contributor III
Contributor III
Author

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,
Anonymous
Not applicable

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