Can DDL Statements Be Used in PL/SQL

Q

Can DDL Statements Be Used in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL

✍: FYIcenter.com

A

No, you can not run any DDL statements is PL/SQL directly. If you try to use the DROP TABLE statement inside PL/SQL, you will get a compilation error as shown below:

(Connect to XE with SQL*Plus)

BEGIN                                                          
  DROP TABLE student; -- compilation error
END;   
/

2007-04-28, 4831👍, 0💬