[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

strange dbi

John Fabiani

8/14/2006 3:41:00 PM

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:in `fetch_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:in `fetch_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:in `select_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:in `select_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