I have a cursor that seems to run fine in Sybase IQ.
However, within the cursor's fetch loop I have to update another table. When I perform the insert or the update code, the cursor loop ends. If I comment out the insert AND the update, the code runs fine (but of course, does nothing other than print out what it is doing).
Is updating not allowed within a loop? I am NOT updating the table that is in the cursor. I'm only using the cursor to identify what needs to be updated.
The code is below:
create procedure sp_locktrak as
DECLARE loktrak NO SCROLL CURSOR FOR
SELECT encntrSID, ToUnitDTM, lvunitdtm, currlocid
ORDER BY encntrsid, tounitdtm ASC
FOR READ ONLY