strange dbi

Discussion in 'Ruby' started by johnf, Aug 14, 2006.

  1. johnf

    johnf Guest

    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
    johnf, Aug 14, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulloa
    Replies:
    1
    Views:
    525
    Juha Laiho
    Jul 22, 2004
  2. Jerome Hauss
    Replies:
    0
    Views:
    166
    Jerome Hauss
    Oct 13, 2004
  3. John Fabiani

    strange (to me) dbi access statements

    John Fabiani, Aug 10, 2006, in forum: Ruby
    Replies:
    0
    Views:
    115
    John Fabiani
    Aug 10, 2006
  4. Asby

    Mason, DBI, and DBI::Pg

    Asby, Jul 24, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    173
  5. Tim Haynes
    Replies:
    3
    Views:
    140
    Ron Reidy
    Sep 13, 2003
Loading...

Share This Page