On Wed, 2009-07-29 at 10:35 -0700, Craig White wrote: > On Wed, 2009-07-29 at 19:24 +0200, Marnen Laibow-Koser wrote: > > Craig White wrote: > > Note that I said: > > >> (You might need parentheses around :ids in the query. I'm not sure.) > > > > Note that the generated query is > > [...] > > > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > > > '24','25','26','27') > > > > So it looks like adding the parentheses will fix your problem. > > > > > So I am still in the creek without a paddle > > > > No you're not. You have a simple syntax error that I even foresaw and > > suggested a fix for in my earlier post. > ---- > I have traced parens around, inside, outside and nothing works... > > >> @taxauthids = ([ "24", "25", "26", "27" ]) > => ["24", "25", "26", "27"] > >> @debts = Debtortranstaxes.find(:all, :conditions => ["taxauthid > IN ?", @taxauthids]) > ActiveRecord::StatementInvalid: Mysql::Error: You have an error in your > SQL syntax; check the manual that corresponds to your MySQL server > version for the right syntax to use near ''24','25','26','27')' at line > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > '24','25','26','27') > > >> @taxauthids = ([ "24", "25", "26", "27" ]) > => ["24", "25", "26", "27"] > >> @debts = Debtortranstaxes.find(:all, :conditions => ["taxauthid > IN ?", @taxauthids]) > ActiveRecord::StatementInvalid: Mysql::Error: You have an error in your > SQL syntax; check the manual that corresponds to your MySQL server > version for the right syntax to use near ''24','25','26','27')' at line > 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN > '24','25','26','27') > > >> @taxauthids = [( "24", "25", "26", "27") ] > SyntaxError: compile error > (irb):13: syntax error > @taxauthids = [( "24", "25", "26", "27") ] > ^ > (irb):13: syntax error > @taxauthids = [( "24", "25", "26", "27") ] > ^ > (irb):13: syntax error > @taxauthids = [( "24", "25", "26", "27") ] > ^ > from (irb):13 > > also - see previous examples from previous e-mail ---- one more... >> @taxauthids = [ "24", "25", "26", "27" ] => ["24", "25", "26", "27"] >> @debts = Debtortranstaxes.find(:all, :conditions => ["taxauthid IN ?", (@taxauthids)]) ActiveRecord::StatementInvalid: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''24','25','26','27')' at line 1: SELECT * FROM `debtortranstaxes` WHERE (taxauthid IN '24','25','26','27')
This just simply does not work. I think that even though I am not the most knowledgeable Rails user, this suggests unacceptable state of affairs for current Rails. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

