Cannot Use DDL Statements in PL/SQL in Oracle

Q

Can DDL Statements Be Used in PL/SQL in Oracle?

✍: 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;   
/

 

Working with Database Objects in Oracle PL/SQL

⇒⇒Oracle Database Tutorials

2016-10-17, 144👍, 0💬