Geoffrey:  Here's the way I format a 2-cursor routine.   Compare this to 
yours and see if 
maybe your structure could be changed to work better.

Karen


DROP CUR lit1 ; DROP CUR lit2
DECLARE lit1 CURSOR FOR SELECT columns FROM table WHERE ... ORDER BY ....
DECLARE lit2 CURSOR FOR SELECT columns FROM table WHERE ... ORDER BY ....
OPEN lit1
WHILE 1 = 1 THEN
  FETCH lit1 INTO vars
  IF SQLCODE = 100 THEN
     BREAK
  ENDIF

   *( do stuff with 1st table)


   OPEN lit2 RESET
   WHILE 1 = 1 THEN
      FETCH lit2 INTO vars
      IF SQLCODE = 100 THEN
         BREAK
      ENDIF

     *(do stuff with the 2nd table)
   ENDWHILE

ENDWHILE
DROP CUR lit1 ; DROP CUR lit2

Karen


 
> Thanks Emmit,
>  With the variable in question I've tried declaring it with a REAL type 
> without setting it to a value (this should give it a null value), 
> initializing it to 0, and not decalaring it (it gives an error - variable not 
> found).  
> The first cursor FETCHes values into the variable OK.  The 2 other 
> variables are populated by a variable form and receive valid values.
>      Geoffrey
> 

Reply via email to