I am trying to restrict the number of rows by using context variable but it's sending all the rows from the table. All record are coming as output in query window too.
Kindly help in this regard.
Solved! Go to Solution.
I think I know what is wrong, but you haven't shown what I need to see. Can you show me the query as text (not a screenshot) and explain the flow of data. It looks like the order of processing is wrong. Your context variable when the query is processed and fired will always be 0 as it is not set until the end of the flow. You also have a timing issue with when queries are generated and when context variables are set. A rule of thumb is that if you want to use a context variable in a query, that it needs to be set in a prior subjob (or in a previous iteration).
There is no other job associated with it . it's a single job.
Even I am able to print the MAXID coming from the variable. but issue is not restricting.
"SELECT IFNULL(MAX(actor_id),0) AS MAXID FROM actor WHERE flag='Y'"
>This is to get the maximul actor_id from the table with flag='Y'
If table has 100 rows I need to show only 10 rows based on variable
"SELECT * FROM actor where actor_id> '+context.MAXID+' "
This is to restrict the rows.
Let me know if you need more info.