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

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: [ECPG] generates bad code on declare/open
Дата
Msg-id 20020110082356.GC11923@feivel.credativ.de
обсуждение исходный текст
Ответ на [ECPG] generates bad code on declare/open  (Tim Nelson <TNELSON@ECS-INC.com>)
Список 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@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Christof Petig
Дата:
Сообщение: Re: dynamic sql in ecpg
Следующее
От: "Jeroen T. Vermeulen"
Дата:
Сообщение: libpqxx update