MySQL Forums
Forum List  »  Perl

Re: scalars in sql statement
Posted by: Felix Geerinckx
Date: November 15, 2006 07:43AM

Romina Drees Wrote:
-------------------------------------------------------

> I've a problem with filling in values into a table through following statement:
>
> $dbh->do('INSERT INTO protein (sequence) VALUES ($1)');

Single quotes do not interpolate variables in Perl.

But it's better to use placeholders anyway:

$dbh->do('INSERT INTO protein (sequence) VALUES (?)', undef, $1);

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
November 15, 2006 06:25AM
Re: scalars in sql statement
November 15, 2006 07:43AM
November 15, 2006 08:12AM
November 15, 2006 08:21AM
November 15, 2006 08:32AM
November 15, 2006 08:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.