Drop only if table exists. : Drop Table « Table « Oracle PL/SQL Tutorial






SQL> BEGIN
  2
  3    FOR i IN (SELECT table_name FROM user_tables WHERE table_name = 'SHARED_ALL') LOOP
  4      EXECUTE IMMEDIATE 'DROP TABLE shared_all';
  5    END LOOP;
  6
  7  END;
  8  /

PL/SQL procedure successfully completed.

SQL>








6.8.Drop Table
6.8.1.Dropping a Table
6.8.2.DROP TABLE with CASCADE CONSTRAINTS
6.8.3.ORA-04091: table JAVA2S.DETAIL_TABLE is mutating, trigger/function may not see it
6.8.4.Drop only if table exists.