First, I feel your pain. I have had to build keywords that deal with queries with many columns and it gets dizzying.
Depending on the DB driver, you may be able to reference column values by name
Should Be Equal ${columnValues[0]['StreetAddress']} ${expected street address}
This has worked for me using MSSQL via adodbapi(pywin32).
Not so for MySQL or Oracle :(
You can return a dictionary from MyQueries keyword to make things easier. Here's an example I found:
${result} Query Select ch.CUSTOMER_ID,ch.PHONE_NUMBER...
${business customer} Create Dictionary
Set To Dictionary ${business customer} customer id ${result[0][0]}
Set To Dictionary ${business customer} phone number ${result[0][1]}
...
[Return] ${business customer}
If you also build a dictionary in your MyFields keyword with the same keys, comparing them could be as easy as:
Collections.Dictionaries Should Be Equal ${fieldsValues} ${columnValues}
If your query is simple like getting many columns from one table (likely not the case), you could do it all based on a list...
${columns} Create List COLA_NAME COLB_NAME etc.
${column names} Catenate SEPARATOR=,${SPACE} @{columns}
${rs} Query SELECT ${column names} FROM MY_TABLE fit WHERE ID = 5
${results} Create Dictionary
${column count} Get Length ${columns}
:FOR ${index} IN RANGE ${column count}
Set To Dictionary ${results} ${columns[${index}]} ${rs[0][${index}]}
Kevin