Claudine:

01.     At the end of DECLARE cursor CURSOR block, you may also want to use
        the DROP CURSOR cursor.

02.     DROP CURSOR cursor clears/removes the cursor definition from memory
        as well as frees the table lock.

03.     It is also a good practice to DROP CURSOR cursor before DECLARing
        cursor CURSOR (just to be safe).

Hope that helps!

Enjoy the latest 1.863xRT03 (and soon to be released:1.864xRT03) of the The
Glorious R:BASE 2000 (version 6.5++)!

Very Best Regards,

Razzak.


At 11:59 PM 1/30/2003 -0600,  Claudine Robbins 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



Reply via email to