Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > strange dbi

Thread Tools

strange dbi

Posts: n/a

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.

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:atabaseError)
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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
strange (to me) dbi access statements John Fabiani Ruby 0 08-10-2006 05:18 PM
DBI Mysql storing DBI:binary, trouble with character 26 Jerome Hauss Ruby 0 10-13-2004 03:04 PM
DBI and DBI::Oracle packages configuration ulloa Perl 1 07-22-2004 05:52 PM
DBI problem : How can I load quickly one huge table with DBI ??. Tim Haynes Perl Misc 3 09-13-2003 03:43 AM
Mason, DBI, and DBI::Pg Asby Perl Misc 0 07-24-2003 09:04 PM