pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Philip Yarra <philip@utiba.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
To: jiri.langr@konero.cz
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [BUGS] Bug #904:  Deallocating of prepared statement in ECPG at
Date: Thu, 20 Mar 2003 10:10:31 +1100
Message-ID: <200303201010.31228.philip@utiba.com> (raw)
In-Reply-To: <200303192131.h2JLVcQ14766@candle.pha.pa.us>
References: <200303192131.h2JLVcQ14766@candle.pha.pa.us>

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 printed to console
	*/
        EXEC SQL DISCONNECT ALL;

}



view thread (6+ messages)  latest in thread

Message-ID: <200303201010.31228.philip@utiba.com>
Permalink:  ../200303201010.31228.philip@utiba.com/
Also on:    postgresql.org/message-id/200303201010.31228.philip@utiba.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: philip@utiba.com, pgman@candle.pha.pa.us, jiri.langr@konero.cz
  Subject: Re: [BUGS] Bug #904:  Deallocating of prepared statement in ECPG at
  In-Reply-To: <200303201010.31228.philip@utiba.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox