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

 

Use Variables in SQL Statements in Oracle

Use DML Statements in PL/SQL in Oracle

Working with Database Objects in Oracle PL/SQL

⇑⇑ Oracle Database Tutorials

2018-10-13, 1778🔥, 0💬