Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print all the fields in a record

 
Siegfried Heintze
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • 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:

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'll find an answer here.
 
Siegfried Heintze
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic