I am in the process of converting a bunch of SQL statements that run daily as a called script in SQLPlus into PL/SQL statements called from oracle job schedular. I'm not too familiar with the advantages that PL/SQL gives over DDL, so first I'll outline what is currently done:
1. DROP TABLE A CASCADE CONSTRAINTS
2. CREATE TABLE A
3. INSERT INTO A (SELECT * FROM B)
4. CREATE INDEX AI1 ON A (...)
5. CREATE INDEX AI2 ON A (...)
So... I'm guessing the original creator dropped the table to rid himself of the indexes, then recreated, inserted, and made the indexes again. What's the best way to do this with PL/SQL? About 17million rows will be inserted into this table, which I'm guessing the reason behind dropping the indexes, is that still advisable using plsql?