extracting a variable from redshift and using it in a loop

One Star

extracting a variable from redshift and using it in a loop

I have a query that will extract exactly one integer, as such:
select max(int_column) from table
I want to take that integer, j, and put it into a tLoop, with
while
declaration: int i = 0
condition: i <= j
iteration: i++
I'm having trouble finding a way to turn my query into a variable.  Thank you for any help.
One Star

Re: extracting a variable from redshift and using it in a loop

I got something to work, though I don't think it's the most efficient.
put the query in tRedshiftInput
row1(Main) to tFlowToIterate
iterate to tJava, with code: globalMap.put("max", (int)row1.int_column);
tLoop with
while
declaration: int i = 0
condition: i <= (int) globalMap.get("max")
iteration: i++