Skip site navigation (1) Skip section navigation (2)

Re: [ECPG] generates bad code on declare/open

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Tim Nelson <TNELSON(at)ECS-INC(dot)com>
Cc: "'pgsql-interfaces(at)postgresql(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [ECPG] generates bad code on declare/open
Date: 2002-01-10 08:23:56
Message-ID: 20020110082356.GC11923@feivel.credativ.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Wed, Jan 09, 2002 at 12:06:52PM -0500, Tim Nelson wrote:
> How do I handle host variables passed in the where clause
> of a declared cursor?  It seems "ecpg" 2.9 takes the declare/open
> and puts the resulting code near the open.  This seems to be a bad
> thing if the host variable is declared in a different block or function:

This is not really bad code but a documented feature. PostgreSQL does not
have an "open cursor" statement, but instead opens the cursor when it is
declared. So what else can ecpg do other than moving the declaration to the
open statement? You cannot open the cursor when the declare is issued
because the declaration might be outside the scope of the executing
function.

Michael
-- 
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

pgsql-interfaces by date

Next:From: Jeroen T. VermeulenDate: 2002-01-10 23:27:04
Subject: libpqxx update
Previous:From: Christof PetigDate: 2002-01-10 07:41:20
Subject: Re: dynamic sql in ecpg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group