syntax error on SQL statement

Discussion in 'Ruby' started by laredotornado@zipmail.com, Jan 17, 2008.

  1. Guest

    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
     
    , Jan 17, 2008
    #1
    1. Advertising

  2. On 17 Jan 2008, at 17:06, 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
    > 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
    >
     
    Frederick Cheung, Jan 17, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski

    SQL syntax error in INSERT INTO statement

    Nathan Sokalski, Jul 1, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    14,689
    ahmed_samir
    Sep 3, 2010
  2. dthmtlgod

    Syntax Error on SQL statement

    dthmtlgod, Oct 8, 2004, in forum: ASP General
    Replies:
    6
    Views:
    142
  3. Maximus

    Syntax Error in SQL Update Statement

    Maximus, Feb 26, 2007, in forum: ASP General
    Replies:
    3
    Views:
    143
    Bob Barrows [MVP]
    Feb 26, 2007
  4. Ken Bloom
    Replies:
    3
    Views:
    230
  5. Mark Richards
    Replies:
    3
    Views:
    337
    Tad McClellan
    Nov 18, 2007
Loading...

Share This Page