AW: [HACKERS] Declare Cursor question again - Mailing list pgsql-hackers

From Andreas Zeugswetter
Subject AW: [HACKERS] Declare Cursor question again
Date
Msg-id 01BDC129.015FAFF0@zeugswettera.user.lan.at
Whole thread Raw
Responses Re: [HACKERS] Declare Cursor question again  ("Dr. Michael Meskes" <meskes@online-club.de>)
List pgsql-hackers
>Is the following legal:
>if (<condition>) {
>        exec sql declare cur cursor for
>                select name, nr from table where nr < 10;
>}
>else {
>        exec sql declare cur cursor for
>                select name, nr from table where nr >= 10;
>}
>
>That is declaring one cursor in two different ways? Oracle cannot do that.
>We can, though. Shall I disable this (and remove my last changes) or is this
>a good feature (as I think it is) and we keep it? Only disadvantage is that
>the declare tarnslates into a C statement and is not really a declaration
>anymore.

Informix can't eighter:
informix@zeus:/usr/informix> esql hallo.ec
esqlc: "hallo.ec", line 9: Error -33055: The name cur has already been used.
1 error(s) found

I guess the objective has to be: be fast during execution
and therefore a declare is probably better.

Andreas


pgsql-hackers by date:

Previous
From: Andreas Zeugswetter
Date:
Subject: AW: [HACKERS] Large objects names
Next
From: "Sergey E. Levov"
Date:
Subject: Re: [HACKERS] SPI procedure for removing large objects