I\'m writing some migration scripts for an Oracle database, and was hoping Oracle had something similar to MySQL\'s IF EXISTS
construct.
Specifically, w
Another method is to define an exception and then only catch that exception letting all others propagate.
Declare
eTableDoesNotExist Exception;
PRAGMA EXCEPTION_INIT(eTableDoesNotExist, -942);
Begin
EXECUTE IMMEDIATE ('DROP TABLE myschema.mytable');
Exception
When eTableDoesNotExist Then
DBMS_Output.Put_Line('Table already does not exist.');
End;