Re: ecpg "problem" ...

From: Jakub Ouhrabka <jouh8664(at)ss1000(dot)ms(dot)mff(dot)cuni(dot)cz>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ecpg "problem" ...
Date: 2002-11-12 20:05:52
Message-ID: Pine.LNX.4.44.0211122103090.2951-100000@server
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi,

i think that ecpg is only text preprocessor. it doesn't understand the c
semantics - it goes from the top to the end of the file row by row and
sees your declaration twice.

kuba

On Tue, 12 Nov 2002, Marc G. Fournier wrote:

>
>
> if (ic_flag == 1) {
> /*only select those non-IC/Spyder nodes that has full update set*/
> EXEC SQL DECLARE full_dyn_node CURSOR FOR
> SELECT node_name FROM NODE
> WHERE dynamic_community = 'f' AND ic_flag='n' AND machine_type!=22
> AND node_id != 0 AND NODE_NAME != :nodename;
> }
> else{
> EXEC SQL DECLARE full_dyn_node CURSOR FOR
> SELECT node_name FROM NODE
> WHERE dynamic_community = 'f'
> AND node_id != 0 AND NODE_NAME != :nodename; (line#493)
> }
>
> the above code generates the following error:
>
> The compiler complains:
> ../subapi.pgc:493: ERROR: cursor full_dyn_node already defined
>
> since its envelop'd in an if/else clause, shouldn't it work?
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-11-12 20:08:15 Re: RC1?
Previous Message Tom Lane 2002-11-12 19:49:54 Re: Idea for better handling of cntxDirty