From: Mark Probert Date: 2002-07-09T01:10:36+09:00 Subject: Ruby.DBI -- select where ... Hi. This is a Ruby-DBI question. I am using 0.0.15 under ruby 1.6.6 (cygwin). I am using ODBC to connect to a SQL 7 database. The connection and test programs work fine. However, when I do: require 'dbi' dbh = DBI.connect('DBI:ODBC:pubs', 'bob', 'bob') state = "CA" sth = dbh.prepare("select au_lname, au_fname from authors where state = #{state}") sth.execute I get: /usr/local/lib/ruby/site_ruby/1.6/DBD/ODBC/ODBC.rb:129:in `prepare': S0022 (207) [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'CA'. (DBI::DatabaseError) from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:536:in `prepare' from select_1.rb:8 Is there a problem in using where clauses in DBI with ODBC? Or am I doing something wrong? TIA, -mark. --------------------- Mark Probert (probertm@nortelnnetworks.com) Nortel Networks -- Optera Metro 3000 GNPS Phone: (613) 768-1082 [ESN: 398-1082]