Cursor will fetch the records at --

OPEN Temp_work_cursor ;

so, I don't think this will make it go into infinite loop. There must be another place that is causing the problem.

The FOR LOOP looks syntactically wrong but as you said that you simplified the code...

- Rajeev