Quote:
Originally posted by gopalkamat
I received an ORA-01002 "fetch out of sequence" Error Message while running the stored procedure attached herewith. The Line Number of error was 190 (which is a FOR LOOP cursor call).
Can any of you please go through it and help me figure out the cause of the error?
Thanks in advance! :-)
|
I have one question...
Could you use an EXIT WHEN statement instead of an IF statement for your debugging? I'm not certain how the PL/SQL parser treats the exit command. On the other hand, using EXIT WHEN counter > 100 is common.
You have a significant number of cursors, some only populating linear variables (versus an array). I have seen this technique used to ensure you don't encounter a TOO_MANY_ROWS error, but you could also use anonymous blocks with a SELECT statement and use an order by to capture the latest record. I think this would be easier to maintain than a procedure full of cursors where you have to keep track of all the END LOOP statements.
I realize this might not address your problem, but I noticed these things as I was looking through your code...