twaitforsql and java.sql.SQLException: Result set after last row

Seven Stars

twaitforsql and java.sql.SQLException: Result set after last row

Hi

I have a scenario where I need to run a set of jobs depending on a output of a sql, so i'm using twaitforsqldata. the SQL has to be executed only once, only if it returns a row, the flow should proceed otherwise it has to skip all jobs. when i use the below sql in twaitforsqldata, i'm getting the error  "java.sql.SQLException: Result set after last row", when i searched it seems like java produces this error when the sql returns no rows. Even when there is a option to check for Zero rows in twaitforsqldata, why am I getting this error? and is there any way to handle this in twaitforsqldata ( at this moment i don't want to use a java component)

 

SELECT '1' col FROM table1 WHERE (select somefunction('dfd') from dual) = 'YES'

thanks

mj

Twelve Stars

Re: twaitforsql and java.sql.SQLException: Result set after last row

use count(*) in place of 1 then test value into a tmap then use tflow to iterate tu link to your job.

Francois Denis

Tag as "solved" for others! Kudos to 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