I need your help resolving an issue for a friend of mine. She is in the process of writing a program to delete rows from 4 tables. She has nested cursors in her program, first cursor is to fetch data from a parent table, which will be used to fetch and delete from other Child tables. She has declared her cursors with " WITH HOLD", but when she commits her work on child table and trying to delete from parent table she is getting sql code of -508. How do I go about fixing this issue.
The -508 means that you are deleting where the cursor is positioned you should declare the cursor : declare cursor ... for update in that case the cursor is really positioned and no buffering is done.