• Thank you all for your great comments.

    Yes the CUSSOR was deallocated and closed. As I mentioned in my original post it is working fine with 2000. I had read somewhere that the structure of CURSOR has been modified in the later version. I haven't read the syntax very well. When I was playing with the code and thought to specify the contest as local and it worked.

    Please post me back if you find it is not actually working because of the local context.

    B Raj Dhakal