Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Place SQL statements in PL/SQL procedure but failed...
> create or replace procedure testing as
> begin
> create table a as ...
> create view b as ...
> truncate table c;
> drop table c;
> end;
>
> However, there is something wrong in compilation.
You can't issue DDL commands from PL/SQL. Sorry.
However, you can use dynamic SQL to do it, using DBMS_SQL. Check out
this URL:
http://technet.oracle.com/doc/server.804/a58236/05_ora.htm#1196
It gives an example of DDL commands with PL/SQL and dynamic SQL. Good luck!
Dave
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Jan 06 2000 - 14:27:31 CST
![]() |
![]() |