I am new to python. Could someone help me to figure out how to execute following commands using cx_Oracle in python?
- Spool C:\drop_tables.sql
- SELECT 'DROP TABLE ' || table_name || ' CASCADE CONSTRAINTS;' FROM user_tables;
- Spool off
- @C:\drop_tables.sql
I know I can use cursor.execute() for 2nd command but for other non sql commands specially 1 & 3 I am not getting any clue.
Appreciate if someone can help.
Thanks, Aravi
SPOOLat all? Can't you just read the table names from the cursor into a list and then run aDROP TABLEstatement for each table in the list?