AnsweredAssumed Answered

GROOVY looping of SQL result

Question asked by gouthamr388096 on Dec 5, 2016
Latest reply on Dec 8, 2016 by gouthamr388096

I have a custom function where I first query MySQL. The query returns two rows. The field query returns is RunId's and SampleId's. Now I want to take these two RunId's and store in a GROOVY hash map.

 

I am using something like below in the code

 

HashMap<String,String> Samplehm = new HashMap<String,String>();
Samplehm .put(RunId, SampleId);

 

The problem i have is that the above code only stores the first value. I want all values of RunId's and SampleId's when I use Samplehm .put(RunId, SampleId);

Do I have to use a loop to loop thru the two rows that are returned in the query?

 

Thanks,

G

Outcomes