Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Place SQL statements in PL/SQL procedure but failed...

Re: Place SQL statements in PL/SQL procedure but failed...

From: <dpurrington_at_my-deja.com>
Date: Thu, 06 Jan 2000 20:27:31 GMT
Message-ID: <852tr0$ckp$1@nnrp1.deja.com>

> 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US