PGConn - qutie a trivial question from a newb

Hello,

I have this code:

 28  dbh = get_connection
 29  res = dbh.exec("select max(ogc_fid) from #{table};")
 30  max =  res[0]
 31
 32  puts max

Which successfully prints the SQL query to the terminal. I want to be
able
to use the result later in the code, but I’m not really clear what type
of
object is being returned. How can I figure out what is being returned
and
convert it to an integer or a string?

Thanks,

On Thu, 30 Nov 2006, Nick B. wrote:

Which successfully prints the SQL query to the terminal. I want to be able
to use the result later in the code, but I’m not really clear what type of
object is being returned. How can I figure out what is being returned and
convert it to an integer or a string?

i’m not quite sure what you’re asking, but i think exec returns rows.

http://ruby.scripting.ca/postgres/rdoc/

-a