#1 db.do returns '0' with Postgresql

open
nobody
None
5
2002-06-29
2002-06-29
Dave Thomas
No

dbi 0.15. ruby-postgres 0.6.5

The following program returns '0' from the db.do, where
I was expecting to see a row count.

<pre>
require 'dbi'

db = DBI.connect(*ARGV)

db.do("create table fred(i int)")
5.times {|i| db.do("insert into fred values(#{i})")}

puts db.select_all("select * from fred")

rpc = db.do("update fred set i=i*2")
puts "Expected a count of '5', got '#{rpc}'"

db.do("drop table fred")
</pre>

Cheers

Dave

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks