From: doug.tillman@... Date: 2002-10-07T06:06:43+09:00 Subject: Simple DBI Question Hi, I'm a Ruby new-bee and am working on a simple DBI example. I just want to get sysdate back from my Oracle instance and print it to screen. It seems like I'm connecting successfully but I don't know how to read the result back properly. Below is the code I'm using - any help appreciated. Regards, Doug equire 'dbi' class Dbitest attr :today_str DBI.connect('DBI:Oracle:fqa1', 'my_username', 'my_pwd') do | dbh | puts "getting..." sql = "select to_char(sysdate + 1, \'MON-DD-YYYY\') today_str from dual" dbh.prepare(sql) do | sth | # print "#{ sth.execute()}" today_str = sth.execute() end end end #end class d = Dbitest.new print "today: #{@today_str}"