No matter what I do, I receive errors from  from the DB driver. Take
these two examples:

DB = Sequel.odbc('md', :user => 'qwert12345', :password => '123...@#$
%')
DB.logger = Logger.new(STDOUT, Logger::DEBUG)
p DB[:users].select('name').map { |r| r[:name] }.join(', ')
DB.disconnect

Gives me:
I, [2010-02-05T11:01:52.713915 #4939]  INFO -- : SELECT 'name' FROM
"USERS"
/usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/adapters/odbc.rb:
51:in `run': ODBC::Error: 37000 (170) [unixODBC][FreeTDS][SQL
Server]Line 1: Incorrect syntax near 'USERS'. (Sequel::DatabaseError)
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
adapters/odbc.rb:51:in `execute'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
connection_pool.rb:149:in `hold'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
database.rb:532:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
adapters/odbc.rb:49:in `execute'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
dataset/actions.rb:100:in `execute'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
adapters/odbc.rb:96:in `fetch_rows'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
dataset/actions.rb:61:in `each'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
dataset/convenience.rb:159:in `map'
        from /usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/
dataset/convenience.rb:159:in `map'

Using:
p DB[:ASDB].map { |r| r[:Identifier] }.join(', ')

I receive:
I, [2010-02-05T11:10:12.573062 #4966]  INFO -- : SELECT * FROM "ASDB"
/usr/lib/ruby/gems/1.8/gems/sequel-3.8.0/lib/sequel/adapters/odbc.rb:
51:in `run': ODBC::Error: 37000 (170) [unixODBC][FreeTDS][SQL
Server]Line 1: Incorrect syntax near 'ASDB'. (Sequel::DatabaseError)

unixODBC and FreeTDS work fine on this box when using Ruby DBI or
ODBC, isql, etc...

In the first example the table is queried as "USERS". This will cause
problems when the DB is case sensitive.

-Skye

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to