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

ecpg cursors and scope

From: Dave Broudy <shaggy(at)broudy(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ecpg cursors and scope
Date: 1999-04-21 01:46:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
I have two senarios about scoping and ecpg's parsing of cursor

A) In seperate functions:

func1() {
  exec sql declare test_cur for ...
func2() {
  exec sql declare test_cur for ... /* same or different sql */

B) In an if:

if(...) {
  exec sql declare test_cur for ...
} else {
  exec sql declare test_cur for ... /* same or different sql */

These both yield "cursor test_cur already defined"

Is this by design? I seem to remember it working under 6.3.2, and this is
under 6.4.2

If I knew lex/yacc, I'd make an effort at a patch, alas my compilers class
of a few years ago made us parse the old fashioned way :) Does anyone know
of a work-around?


Dave Broudy             dave(at)broudy(dot)net


pgsql-interfaces by date

Next:From: Thomas LockhartDate: 1999-04-21 03:36:49
Subject: Re: [INTERFACES] Error in ECPG and #if...
Previous:From: David SmithDate: 1999-04-20 22:18:59
Subject: Macintosh ODBC port?

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