If view exists, drop view : Drop View « View « Oracle PL/SQL Tutorial






SQL>
SQL> BEGIN
  2    FOR i IN (SELECT null FROM user_views WHERE view_name = 'BOOKS_emp') LOOP
  3      EXECUTE IMMEDIATE 'DROP VIEW books_emp';
  4    END LOOP;
  5  END;
  6  /

PL/SQL procedure successfully completed.








8.6.Drop View
8.6.1.Dropping a View
8.6.2.If view exists, drop view