Tuesday, 5 May 2015

DROP all tables starting with “Na_” in Oracle

BEGIN
  FOR c IN ( SELECT table_name FROM user_tables WHERE table_name LIKE 'EXT_%' )
  LOOP
    EXECUTE IMMEDIATE 'DROP TABLE ' || c.table_name;
  END LOOP;
END;

No comments:

Post a Comment