MySQL Forums
Forum List  »  Perl

Re: How to use quotation marks in query-strings ?
Posted by: Felix Geerinckx
Date: January 29, 2007 01:59AM

Tim Vantag Wrote:

> But. When I try to run this query in perl-program I get errors because of CONCAT

Not because of CONCAT().
> String found where operator expected
This is a Perl error.
> my $sql = "SELECT s.name, CONCAT('"',f.lastname,'"')AS lastname FROM `firsttable` f, `secondtable` s WHERE f.id = s.tID AND something='$variableID'";
Use Perl's qq{} quoting scheme:
my $sql = qq{
    SELECT 
        s.name, 
        CONCAT('"',f.lastname,'"') AS lastname 
    FROM `firsttable` f, `secondtable` s 
    WHERE 
        f.id = s.tID AND 
        something='$variableID'
};

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

Options: ReplyQuote


Subject
Written By
Posted
Re: How to use quotation marks in query-strings ?
January 29, 2007 01:59AM


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.