I'm using 2-D arraylist to store the query results of sql.rows in SOAP UI Groovy. Outputrows, in the below code, is an arraylist.
Outputrows = sql.rows("select CORR.Preferred as preferred ,CORR.Category as category,CORR.Currency as currency\
from BENEFICIARY CORR \
JOIN LOCATION LOC on CORR.UID=LOC.UID")
The problem with the arraylist is that I'm unable to update any value of a particular cell with the set command. Set is not a valid one for GroovyRowResult class.
Outputrows.get(row).set(col,categoryValue)
So I am just wondering if I can store the queryresults(Outputrows) to a 2D Map(Outputrows) and if so, how can I update the value of any particular row with the given map key.
[{'preferred': 'N', 'category': 'Commerical'}, {'currency': 'USD'}.. ] and so on.
If I want to update Currency for the 3rd row, how can I update that.
Data in the output
Preferred | Category | Currency |
----------------------------------
N | CMP | USD |
----------------------------------
Y | RTL | GBP |
----------------------------------
N | CMP | JPY |
----------------------------------
Y | RTL | USD |
----------------------------------
Now here in 'outputrows' the values are stored from first row(N, CMP, USD) as Arraylist. I would like to store the values of the query result,'outputrows', as a Maps instead of Arraylist, so I can easily access any value in 'outputrows' with Map key.
Hope this makes sense.