Re: SQL statement PREPARE does not work in ECPG - Mailing list pgsql-hackers

From Michael Meskes
Subject Re: SQL statement PREPARE does not work in ECPG
Date
Msg-id 375aaffaf8c6895a38b5c5022cce42cf62c59868.camel@postgresql.org
Whole thread Raw
In response to RE: SQL statement PREPARE does not work in ECPG  ("Matsumura, Ryo" <matsumura.ryo@jp.fujitsu.com>)
Responses RE: SQL statement PREPARE does not work in ECPG
List pgsql-hackers
> I think SQL statement PREPARE *without* parameter is supported,
> but one with parameter is not supported (or has some fatal bugs).

It surely should be supported.

>> I wrote the source code as follows.
>> <test_app.pgc>
>> ============================
>> EXEC SQL PREPARE test_prep (int) AS SELECT id from test_table where
id = $1;
>> EXEC SQL EXECUTE test_prep (2);
>> ============================

Please try this instead:

EXEC SQL PREPARE test_prep (int) AS SELECT id from test_table where id
= $1;
EXEC SQL EXECUTE test_prep using 2;

This should work. 

And yes, it does look like a bug to me, or better like changes in the
backend that were not synced to ecpg.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Speed up transaction completion faster after many relations areaccessed in a transaction
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: shared-memory based stats collector