• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to print all the fields in a record

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying once again to get this to work and I'm now using Groovy 1.7. I used eclipse 3.6 and the groovy console and got the same results.

Why does line 16 not print out all the columns for that record?
Why does it not print the value of each field? What is it printing, the type?

Here are the first few lines of my output


Here is my code that I am running on groovy 1.7:

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please tell us when you crosspost the same question in different forums. Check this FAQ.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you'll find an answer here.
 
Siegfried Heintze
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops! my bad!

Sorry. Yes, I posted this question a year ago and when I still did not get a response a month ago, I posted again and I still have not received a response. As you can see from http://groovy.329449.n5.nabble.com/How-to-display-all-the-fields-in-groovy-Sql-sql-td370614.html I have posted the last two entries with no response.

I have tried the suggestions of the previous posts and I cannot get them to work. I know the information I want is in there

So I am posting here here hoping for a response. I know the row data is in there and I can get it if I hard code the column names. But I want a generic tool. I can print the column names I retrieve from the metadata. The information is there! How do I get the data out of the rec object. They (blackdrag) told me to use the eachrow function and I just cannot get it to work!

Does it work for you?

Thanks,
siegfried
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic