Обсуждение: ECPG scoping

Поиск
Список
Период
Сортировка

ECPG scoping

От
"Stergios Zissakis"
Дата:
Dear all,

Consider the following two functions:

void function1(...)
{ EXEC SQL BEGIN DECLARE SECTION; typedef struct {   varchar temp[100];   ... } my_strct; EXEC SQL END DECLARE
SECTION;
 ...
}

void function2(...)
{ EXEC SQL BEGIN DECLARE SECTION; typedef struct {   varchar temp[100];   ... } my_strct; EXEC SQL END DECLARE
SECTION;
 ...
}

When this goes through the pre-compiler, I get an error message stating:
Type my_struct already defined.

Does ECPG recongise scopes or it parses everything as global space?

One work around is to rename the struct in each function but this is not
really handy as the application I'm porting (from Oracle) uses the same
stucts in a lot of methods.

Any suggestions?

Thanks in advance.

Regards,

Stergios Zissakis



Re: ECPG scoping

От
Michael Meskes
Дата:
On Wed, May 12, 2004 at 11:56:41AM +0300, Stergios Zissakis wrote:
> Dear all,
> 
> Consider the following two functions:
> ...

I just committed a patch to HEAD and 7.4.

Thanks for the report.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!