Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at
От | Philip Yarra |
---|---|
Тема | Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at |
Дата | |
Msg-id | 200303201010.31228.philip@utiba.com обсуждение исходный текст |
Ответ на | Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-interfaces |
On Thu, 20 Mar 2003 08:31, Bruce Momjian wrote: > Can someone comment on this? Ah, this might explain why FREE kept failing on us (see sample code below). Or have I missed something here? Regards, Philip Yarra. int main(int argc, char *argv[]) { EXEC SQL BEGIN DECLARE SECTION; char *target = "bob@snode5"; char *user = "philip"; char *message = "It came from embedded C"; char *pquery = "INSERT INTO test (message) VALUES(?)"; EXEC SQL END DECLARE SECTION; if(argv[1] != NULL) message = argv[1]; EXEC SQL WHENEVER sqlerror sqlprint; EXEC SQL CONNECT TO :target USER :user; /*EXEC SQL SET AUTOCOMMIT TO ON; */ EXEC SQL PREPARE stmt_id FROM :pquery; EXEC SQL EXECUTE stmt_id USING :message; EXEC SQL COMMIT; EXEC SQL FREE stmt_id;/* executing this line causes message"sql error Invalid statement name stmt_id in line 25."to be printedto console*/ EXEC SQL DISCONNECT ALL; }
В списке pgsql-interfaces по дате отправления: