nikhilkini
asked on
DDl inside PL/SQL
can we write DDL statement inside a PL/SQL block how to write a DDL statement inside a PL/SQL block
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, you can use DDL statements in PL\SQL with the "execute immediate" systax as andrewst indicated. Be aware though of the problems/limitations of DDL in PL\SQL. If you create a table this way for example, you cannot reference it in your PL\SQL procedure unless you use "execute immediate" each time. If you drop a table this way, then reference it later in the PL\SQL procedure, it will compile fine, but have a runtime error. Also, the "execute immediate" syntax works, but is usually slower than standard DML syntax in PL\SQL.