Re: stored queries and quoted strings

From: Ragnar <gnari(at)hive(dot)is>
To: filippo <filippo2991(at)virgilio(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: stored queries and quoted strings
Date: 2007-04-02 14:52:20
Message-ID: 1175525540.1153.102.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On fös, 2007-03-30 at 00:31 -0700, filippo wrote:
> Hello,
>
> I have a strange problem with stored queries like this
>
> $sql = qq/
> SELECT city, country
> FROM countries
> WHERE city LIKE ?
> ORDER BY city
> /;
> $sthCity= $dbh->prepare($sql);
> my $tempCity = $dbh->quote("n%");
> $sthCity->execute($tempCity);

> the query doesn't return any value. It works only if I remove the -
> >quote().

you do not have to use quote() on the parameters of a prepared
statement, as this is already done for you.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shoaib Mir 2007-04-02 15:01:50 Re: Increasing the shared memory
Previous Message Sorin N. Ciolofan 2007-04-02 14:52:15 Re: Increasing the shared memory