I need to delete rows from different db2 tables in COBOL with commit in between after some 100 or 200 rows. Is there any away I can restrict my delete statement for some particular rows as in Select for fetch first 100 rows only. The values of table names will be known only during the execution of the program. I thought of trying first select with fetch first 100 rows and use delete where current of option. So I prepared my dynamic sql of select with fetch first 100 rows only and executed fetch statement. Now when I run my delete statement with current of using Execute Immediate, the delete statement is failing. It?s not able to point to the row fetched before. I am executing my delete statement only before the closing the cursor. Without dynamic sql this select and delete current of works fine. It would be a great help if you could give a solution for this.
July 6, 2005 11:18 AM
June 25, 2008 8:06 PM