Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> R: DDL in a PL/SQL block?
Hi, RoadRaat, yes you can put DDL in a PL/SQL block, but you must use a
particular package to do it. You can use Dynamic Sql, this is an example:
dynsql.exec_sql('create table TEMP as select * from dual',dummyVar);
RoadRaat <roadraat_at_aol.com> wrote in message
20000304194710.02650.00000111_at_ng-fh1.aol.com...
> Is it not possible to put Data Definition Language in a PL/SQL block?
>
> I'm writing (what I thought would be a simple) PL/SQL program to loop
through
> all of my current tables and CREATE successive backups AS SELECTs.
>
> My first step was to CREATE a BACKUPLOG table in which I would later
INSERT the
> name of each table I back up in a loop. I've CREATEd tables many times in
> SQL*Plus scripts, but in this PL/SQL the compilation slams to a halt as
soon as
> I get to the first CREATE statement.
>
> Can I just not do that?
>
> Thanks for any help anyone can offer.
>
> RoadRaat
Received on Mon Mar 06 2000 - 04:31:19 CST
![]() |
![]() |