Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

global variable for number of records in tMSSQLRow?

There is a global variable called "NB_LINE" for tMSSQLInput, is there one for (the "recordset" returned by) tMSSQLRow? It really can loop the "recordset" to find the number of rows since the "recordset" is defined as FORWARD_ONLY internally, not sure if it can be overriden.
Labels (2)
5 Replies
Anonymous
Not applicable
Author

There is no a global variable NB_LIN is available on tMSSQLRow, if the component returns a recordset, you need to link it to a tParseRecordSet for parsing the recordset, and there is a global variable NB_LIN is available on tParseRecordSet. You can find an example job in user manual.
https://help.talend.com/pages/viewpage.action?pageId=13798574#Raa48944
Shong
Anonymous
Not applicable
Author

The issue I am running into is when the SQL returns no result, the process flow stops after tParseRecordSet, I am wondering how I can catch this "empty row" exception and keep the process flow going
Anonymous
Not applicable
Author

The issue I am running into is when the SQL returns no result, the process flow stops after tParseRecordSet, I am wondering how I can catch this "empty row" exception and keep the process flow going

Move this processing to a child job, and use a tRunjob to call it, and uncheck the 'die on error' option on tRunJob, the parent job will continue to work even though the child job has an 'empty row' exception.
The job design looks like:
parent job:
other processing
|
onsubjobok
|
tRunJob
|
onsubjobok
|
other processing
child job:
tMSSQLRow--main--tParseRecordSet--tLogRow
Shong
Anonymous
Not applicable
Author

I need to catch this "empty row" scenario to perform proper processing.
Basically, after executing the query, it needs to perform one processing logic if it returns rows, another processing logic if it returns 0 rows, not just simply keeping the whole flow going.
Anonymous
Not applicable
Author

had the same problem. solution at the end of this post http://www.talendforge.org/forum/viewtopic.php?pid=137851#p137851