Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DDL in PL/SQL
You cannot use DML inside a PL/SQL procedure.
Try using DBMS_SQL or DBMS_DDL and pass your statement via that.
Mark
dennishancy_at_eaton.com wrote in message <7j1enh$hqa$1_at_nnrp2.deja.com>...
>
>
>I have a PL/SQL block that looks like the following:
>
>-----------
>declare
> <some variables declared>
>begin
> drop table x;
> create table x
> ( etc, etc, etc...);
> <some DML statements>
>end;
>-----------
>
>When I try to run this, it complains about the "drop" statement. If I
>comment that out, along with the "create" statement, all goes well. Can
>I not use DDL statements in a PL/SQL block like this? Thanks..
>
>
>Dennis Hancy
>Eaton Corporation
>Cleveland, OH
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Jun 03 1999 - 06:24:00 CDT
![]() |
![]() |