Oracle Solution for Error ora-06546

Solution for Oracle Error ORA-06546

ORA-06546: DDL statement is executed in an illegal context

What triggered the Error:

DDL statement is executed dynamically in illegal PL/SQL context. *- Dynamic OPEN cursor for a DDL in PL/SQ. *- Bind variable's used in USING clause to EXECUTE IMMEDIATE a DD. *- Define variable's used in INTO clause to EXECUTE IMMEDIATE a DD.

What should we do to fix it:

Use EXECUTE IMMEDIATE without USING and INTO clauses to execute the DDL statement.