Syntax error on SQL statement

Hi,

I’m using the latest version of Ruby for Fedora Core 6 Linux. I want
to write concise SQL statements, but the following

@subscriber = Subscriber.find(:first, :conditions => “pharmacy_id
= ?”, @pharmacy_id)

is giving me the error:

SyntaxError
/usr/local/apache2/htdocs/easyrx/app/controllers/
register_controller.rb:44: syntax error, unexpected ‘)’, expecting
tASSOC
@subscriber = Subscriber.find(:first, :conditions => “pharmacy_id
= ?”, @pharmacy_id)

What’s the correct way to write the statement?

Thanks, - Dave

On 17 Jan 2008, at 17:06, [email protected] wrote:

Hi,

I’m using the latest version of Ruby for Fedora Core 6 Linux. I want
to write concise SQL statements, but the following

@subscriber = Subscriber.find(:first, :conditions => “pharmacy_id
= ?”, @pharmacy_id)

@subscriber = Subscriber.find(:first, :conditions => [“pharmacy_id
= ?”, @pharmacy_id])

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs