From: Stergios Zissakis <szis@intranet.gr>
To: Interfaces <pgsql-interfaces@postgresql.org>
Subject: ECPG scoping
Date: Wed, 12 May 2004 11:56:41 +0300
Message-ID: <NGBBJHBHDKPNOODGDMMAKENFCHAA.szis@intranet.gr> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: szis@intranet.gr
Subject: Re: ECPG scoping
In-Reply-To: <NGBBJHBHDKPNOODGDMMAKENFCHAA.szis@intranet.gr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox