strange dbi

J

johnf

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top