Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > syntax error on SQL statement

Reply
Thread Tools

syntax error on SQL statement

 
 
laredotornado@zipmail.com
Guest
Posts: n/a
 
      01-17-2008
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
 
Reply With Quote
 
 
 
 
Frederick Cheung
Guest
Posts: n/a
 
      01-17-2008

On 17 Jan 2008, at 17:06, http://www.velocityreviews.com/forums/(E-Mail Removed) 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL syntax error in INSERT INTO statement Nathan Sokalski ASP .Net 5 09-03-2010 02:12 AM
Syntax error? What syntax error? Assignment fo default values? Mark Richards Perl Misc 3 11-18-2007 05:01 PM
Syntax Error in SQL Update Statement Maximus ASP General 3 02-26-2007 07:55 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Syntax Error on SQL statement dthmtlgod ASP General 6 10-08-2004 03:09 PM



Advertisments