Hi Albert,
I don't have a loop structure because I'm simply executing both
commands.  And I do have the drop cursor lines at the beginning and the
end of my file.  Are you saying I should have a loop anyway? ~Claudine

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Albert
Berry
Sent: Friday, January 31, 2003 8:52 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: OPEN cursor RESET

Claudine, I don't see your loop structure, but this is the recommended
structure. I have found that deviating from it can cause me problems.

SET VAR ... -- declare them ALL here
DROP CURSOR c1 -- safety touches
DROP CURSOR c2 --
DECLARE c1 CURSOR FOR .... -- outer cursor
DECLARE c2 CURSOR FOR ...  -- inner cursor
OPEN c1 RESET -- I always use reset even when I don't need it
FETCH c1 INTO ...
WHILE SQLCODE <> 100 THEN
  OPEN c2 RESET
  FETCH c2 INTO
  -- code goes here
  FETCH c1 INTO ...
ENDWHILE
DROP CURSOR c2
DROP CURSOR c1

"Claudine Robbins" <[EMAIL PROTECTED]> wrote:

>FYI: Just a heads-up. The following code (without the RESET after OPEN
>cursor2 and cursor3) worked flawlessly (for at least 5 years) until
>yesterday. �The first one would correctly retrieve the name, the second
>one wouldn't. �After I added RESET, everything is working right again.
>~Claudine :) 
>

Reply via email to