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 :) 
>
> � � �--FETCH CUSTOMER NAME FROM ROLODEX
> � � �DECLARE cursor2 CURSOR FOR SELECT co_name FROM rolodex +
> � � �WHERE co_code IN (SELECT custcode FROM wsorder)
> � � �OPEN cursor2 RESET
> � � �FETCH cursor2 INTO vcustnam
> � � �UPDATE wsorder SET custname = .vcustnam
>
> � � �--FETCH CARRIER NAME FROM ROLODEX
> � � �DECLARE cursor3 CURSOR FOR SELECT co_name FROM rolodex +
> � � �WHERE co_code IN (SELECT carcode FROM wsorder)
> � � �OPEN cursor3 RESET
> � � �FETCH cursor3 INTO vcarname
> � � �UPDATE wsorder SET carname = .vcarname
>
>


-- 
Albert Berry
Full Time Consultant to
PSD Solutions
350 West Hubbard, Suite 210
Chicago, IL 60610
312-828-9253 Ext. 32


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

Reply via email to