Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
16 years ago

groovy SQL Help

I have groovy call to a database with a simple select statement which give me some records. My statement looks something like this.

foobar = sql.rows("select colname from table ....)

printing out foobar shows

{colname=col1}, {colname=col2},.....

My question is, why is 'colname=' getting appended to each of my records. I am expect my list to have
{col1},{col2},....

What am I doing wrong.


Ali

2 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    I'm not exactly sure how you are printing foobar but to me it looks like a list of maps, where each row is a Map containing one key-pair per column. This allows you to do something like

    log.info( foobar[2].colname )

    Does that make sense?

    regards,

    /Ole
    eviware.com