on ‎2019 Mar 07 7:21 AM
I am trying to build a cursor on systable to find all old tables, and then exceute drop table statement on all those tables:
declare tnames insensitive cursor for select table_name from systable where table_name like '%_old';
and then within the loop I execute the drop statement:
execute immediate ('drop table ' + tname) ;
I rceive an error stating that the cursor is not open!! Is this generally possible? Is there any other alternative?
Request clarification before answering.
DROP TABLE has an implicit commit which closes the cursor . You will need to OPEN the cursor WITH HOLD .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.