I know this has been discussed before on the list, but when I set trace on just before a declare cursor statement, I do not see the code between the while and endwhile execute.
 
How am I supposed to find where the error is if I can't see the code ?
 
Here is my code;
 
set trace on
set v vdate1 date=02/08/2012
set v vpropid int=null
set v vSbjTrimMean currency=null
set v vrar double=null
sel RAR into vrar vi1 fro timetrend
set v vSCAPPAV currency=null
set error message 705 off
drop cursor c#1
declare c#1 cursor for select propid fro SCPropdata whe scheardate=.vdate1
open c#1
fetch c#1 into vpropid vi1
while sqlcode <> 100 the
  select SbjTrimMean into vSbjTrimMean vi2 fro CMAmass whe propid=.vpropid
  if vSbjTrimMean > 0.00 the
    set v vSCappav=(.vSbjTrimMean*.vrar)
    update scpropdata set SCAPPEV=.vSbjTrimMean,SCAPPAV=.vSCappav +
      whe propid=.vpropid
  endi
  fetch c#1 into vpropid vi1
endwhile
drop cursor c#1
set trace off
ret
 
Once F10 reaches WHILE SQLCODE <> 100 THE, the next line I see is the ENDWHILE. In the meantime the cursor has gone through 23 rows of data.
 
What causes this ? I need to get this code working.
 
 
Thanks,
 
Bill Eyring

Reply via email to