Hi, i need to write a script that re-creates a table. Something similar to CREATE OR REPLACE VIEW. I came up with the following
DECLARE
does_not_exist EXCEPTION;
PRAGMA EXCEPTION_INIT (does_not_exist, -942);
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE foobar';
EXCEPTION
WHEN does_not_exist
THEN
NULL;
END;
/
CREATE TABLE foobar (c1 INT);
I wonder if there's an easier way. Is there?
TIA, Markus