Re: prepared query plan did not update - Mailing list pgsql-sql

From Emi Lu
Subject Re: prepared query plan did not update
Date
Msg-id 48D164AE.4000601@encs.concordia.ca
Whole thread Raw
In response to Re: prepared query plan did not update  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Responses Re: prepared query plan did not update
List pgsql-sql
Stephan Szabo wrote:
> On Wed, 17 Sep 2008, Emi Lu wrote:
> 
>> Good morning,
>>
>> I tried to use prepared query plan to update columns, but it did not
>> update at all.
>>
>> PREPARE pname(varchar) AS
>> UPDATE t1
>> SET    col1 = false
>> WHERE  col1 AND
>>         col2 = '$1' ;
> 
> I don't think you want those quotes in the second part of the where
> clause. I'm pretty sure that means you're comparing against the literal
> string with a dollar sign and one rather than the value given at execute
> time for $1.

Do you mean:

PREPARE pname(varchar) AS
UPDATE t1
SET   col1 = false
WHERE col1 AND      col2 = $1 ;

But still does not work? Strange, right?



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: prepared query plan did not update
Next
From: Stephan Szabo
Date:
Subject: Re: prepared query plan did not update