X-Original-To: pgsql-interfaces@postgresql.org Received: from cpc-gw2.cpc.net.au (unknown [210.9.248.93]) by postgresql.org (Postfix) with ESMTP id 7B610476311 for ; Wed, 19 Mar 2003 18:16:02 -0500 (EST) Received: from utiba.com (IDENT:root@ser1.cpc.net.au [192.168.0.19]) by (Utiba Mail Thingy 2/1.1.3) with ESMTP id h2JM9vZ07042; Thu, 20 Mar 2003 09:09:57 +1100 Received: from Utiba Mail Thingy by utiba.com (Dunno/1.1.2) with ESMTP id KAA08580; Thu, 20 Mar 2003 10:16:01 +1100 Content-Type: text/plain; charset="iso-8859-1" From: Philip Yarra Organization: Utiba To: Bruce Momjian , jiri.langr@konero.cz Subject: Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at Date: Thu, 20 Mar 2003 10:10:31 +1100 User-Agent: KMail/1.4.1 Cc: PostgreSQL-interfaces References: <200303192131.h2JLVcQ14766@candle.pha.pa.us> In-Reply-To: <200303192131.h2JLVcQ14766@candle.pha.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200303201010.31228.philip@utiba.com> X-Archive-Number: 200303/87 X-Sequence-Number: 3836 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)= .=20 Or have I missed something here? Regards, Philip Yarra. int main(int argc, char *argv[]) { EXEC SQL BEGIN DECLARE SECTION; char *target =3D "bob@snode5"; char *user =3D "philip"; char *message =3D "It came from embedded C"; char *pquery =3D "INSERT INTO test (message) VALUES(?)"; EXEC SQL END DECLARE SECTION; if(argv[1] !=3D NULL) message =3D 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 printed to console */ EXEC SQL DISCONNECT ALL; }