Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Scope of EXEC SQL DECLARE <cursor>

Re: Scope of EXEC SQL DECLARE <cursor>

From: Alex Vinokur <alexander.vinokur_at_telrad.co.il>
Date: Tue, 26 Oct 1999 12:49:35 GMT
Message-ID: <7v480u$u97$1@nnrp1.deja.com>


In article <7v431l$qnj$1_at_nnrp1.deja.com>,   Alex Vinokur <alexander.vinokur_at_telrad.co.il> wrote:
> Hi,
>
> Here is a program containing the same line
> EXEC SQL DECLARE the_cursor CURSOR FOR the_exec;
> in two different functions (foo1 and foo2).
> I have got warning message (see below).
>
> Does it mean that EXEC SQL DECLARE <cursor>
> always has global scope?
> If it is right, what is a reason for that?
> (Does it depend on SQL scope?)
> Ordinary internal variables have a local scope.




Pro*C/C++ Precompiler Programmer's Guide Release 8.0
A58233-01
F. Embedded SQL Commands and Directives Page#F-23

<quote>

Usage Notes

You must declare a cursor before referencing it in other embedded SQL statements. The scope of a cursor declaration is global within its precompilation unit and the name of each cursor must be unique in its scope. You cannot declare two cursors with the same name in a single precompilation unit.

</quote>



Now the matter is clear.

However, if we *cannot declare two cursors with the same name

            in a single precompilation unit*
            why does the precompiler print warning message,
            but not error one?

[snip]

        Alex

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Oct 26 1999 - 07:49:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US