Takahashi-san,
> I tried as follows.
> ...
> Unfortunately, this does not work.
> ECPGst_execute seems good, but prepare statement is the same as my
> first post.
Ah right, my bad. The workaround should have been:
EXEC SQL PREPARE test_prep from "SELECT id from test_table where id =
$1";
EXEC SQL EXECUTE test_prep using 2;
> It fails with "PostgreSQL error : -202[too few arguments on line
> 16]".
>
> This error is caused by following source code.
> ...
> I think next_insert() should ignore "$n" in the case of SQL statement
> PREPARE.
Actually I am not so sure.
> In addition, we should fix following, right?
>
> (1)
> As Matsumura-san wrote, ECPG should not produce '"' for SQL statement
> PREPARE.
Why's that?
> (2)
> ECPG should produce argument for execute statement such as "EXEC SQL
> EXECUTE test_prep (2);"
Correct.
As for the PREPARE statement itself, could you try the attached small
patch please.
This seems to create the correct ECPGPrepare call, but I have not yet
tested it for many use cases.
Thanks.
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