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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Run If rownnum>1

I need to add a conditional requirement to my job to end the job if no new records from a oracle component have been inserted into a record.  If new records have been added then I want to finish the rest of the job (run a stored procedure).  I think i can use 2 conditional run if components to accomplish this but I am running into issues with the syntax
i am going from a oracle_bulk component>>tjava>> run if true(tjava) or run if false(tjava) to try and accomplish this
i have the following code in the first java component which runs and returns true if the record count from the oracle component is greater than one.  However when I add the true/false i can a sytanx error.  What am I missing in the true and false tjava components?


int nb_line=((Integer)globalMap.get("tOracleOutputBulk_1_NB_LINE"));
if(nb_line>0){
globalMap.put("hasRows", true);
}else{
globalMap.put("hasRows", false);
}
System.out.println("hasRows: " + globalMap.get("hasRows"));

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I figured it out.  I was putting my condition in the java components instead of in the run if.  Thanks all!

View solution in original post

3 Replies
lvsiva
Contributor
Contributor

We can get the rows count with the variable  "tMysqlInput_1_NB_LINE" and placed it in link condition like below. 
((Integer)globalMap.get("tMysqlInput_1_NB_LINE")) > 1
You can use Oracle component instead of mysql.
Anonymous
Not applicable
Author

Looks like the screenshots of my job did not upload.  I am unclear what I need to update?  Should I remove the first java component that I have with the if then else condition?
0683p000009MG5O.jpg 
false condition 
0683p000009MG6G.jpg
true condition
0683p000009MFsl.jpg
Anonymous
Not applicable
Author

I figured it out.  I was putting my condition in the java components instead of in the run if.  Thanks all!