The issue is that your generated query is missing parentheses. Why have you tried everything EXCEPT putting them in the SQL fragment? To wit:
@debts = Debtortranstaxes.find(:all, :conditions => ["taxauthid IN (?)", @taxauthids]) --Matt Jones On Jul 29, 1:44 pm, Craig White <craigwh...@azapple.com> wrote: > 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---