Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DDL in a PL/SQL block?
RoadRaat ha scritto nel messaggio
<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
Sure!
You can do it using Dynamic-SQL: refer to the doc for detail.
The basic idea is to put the DDL in a string and then execute it. This work from Oracle 7.3.
Bye! Received on Sun Mar 05 2000 - 10:28:51 CST
![]() |
![]() |