Let's say we have a table with two entries:

name	nr
----------
foo	1
bar	2

and a C program doing the following:

...
i=1;
exec sql declare C cursor for select name from table where nr=:i;
i=2;
exec sql open C;
...

Which row will be selected?

I guess I'll try Oracle as soon as I find time.

Michael
-- 
Dr. Michael Meskes		meskes@online-club.de, meskes@debian.org
Go SF49ers! Go Rhein Fire!	Use Debian GNU/Linux! 

Tue, 4 Aug 1998 19:12:09 +0200
"Dr. Michael Meskes" <meskes@online-club.de>
Standards question
> i=1;
> exec sql declare C cursor for select name from table where nr=:i;
> i=2;
> exec sql open C;
> Which row will be selected?

Things should evaluate at the "open". I recall that the cursor
declaration is allowed to happen up in the declarations section of the
program or routine (at least on my old Ingres installation)...

                   - Tom

Wed, 05 Aug 1998 01:39:54 +0000
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Re: [HACKERS] Standards question
>>>>> "Thomas" == Thomas G Lockhart <lockhart@alumni.caltech.edu> writes:

    >> i=1; 
    >> exec sql declare C cursor for select name from table where nr=:i; 
    >> i=2; 
    >> exec sql open C; Which row will be selected?

    Thomas> Things should evaluate at the "open".
    [...]

This is also how it works with Oracle.

roland
-- 
Roland B. Roberts, PhD                  Custom Software Solutions
roberts@panix.com                           101 West 15th St #4NN
                                               New York, NY 10011


04 Aug 1998 22:00:09 -0400
Roland Roberts <roberts@panix.com>
Re: [HACKERS] Standards question