[Nitro] resultset metadata

Rahul rahul2012 at gmail.com
Fri Jun 9 05:07:36 EDT 2006

i am new to ruby. Came across OG and have been trying it out. I am writing
an program that produces reports based on an sql or tablename provided by
the caller.
The program works fine, except that i cannot get the column names for the
result-set. I tried taking the keys for the first row, but the order of the
keys is (obviously) not the same as that of the fields in the resultset

hsh = res.fetch_hash
hsh.each_key { |key|
    print key + field_sep;
Is there a way of getting resultset metadata?

My second question relates to getting the tablenames of a database. And then
for each table getting the columns and column info. I have managed to do
that using rails but wish to do some simple work outside of rails to begin
with. Can that be done using OG? I wish to port a report generator i once
did in Java.

Please note that my questions relate to tables created outside the OG
framework. A user can connect to any database on the LAN and start using
this program to generate reports.
thanks and regards,
rahul benegal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060609/e4caf45d/attachment.html 

More information about the Nitro-general mailing list