Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at - Mailing list pgsql-interfaces

From Philip Yarra
Subject Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at
Date
Msg-id 200303201010.31228.philip@utiba.com
Whole thread Raw
In response to Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] Bug #904: Deallocating of prepared statement in ECPG at
Next
From: Stéphane Pinel
Date:
Subject: Handling Blobs with libpq