Strange dbi

Hi,

First I’m a newbie to ruby. I’m using SUSE 10.0, ruby 1.8.2, dbi,
freetds,
unixODBC. I’m just testing access to a MS SQL 2000 database. I also
posted this on the forum but no one responsed for two days.

code:
require ‘dbi’
db = DBI.connect(‘dbi:ODBC:mssql’,‘username’,‘password’)

rows = db.select_all(“select * from arcust”)

error messages:
/usr/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:239:in fetch': INTERN (0) [RubyODBC]No data found (DBI::DatabaseError) from /usr/lib/ruby/site_ruby/1.8/dbi.rb:995:infetch_all’
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:994:in loop' from /usr/lib/ruby/site_ruby/1.8/dbi.rb:994:infetch_all’
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:759:in fetch_all' from /usr/lib/ruby/site_ruby/1.8/dbi.rb:515:inselect_all’
from /usr/lib/ruby/site_ruby/1.8/dbi.rb:511:in execute' from /usr/lib/ruby/site_ruby/1.8/dbi.rb:511:inselect_all’
from rubytest.rb:4

However, if I change the sql statement to:
rows = db.select_all(“select custno,company from arcust”)
ALL WORKS. Does anyone have any thoughts regarding why this is
happening?

John

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs