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: DDL in a PL/SQL block?

Re: DDL in a PL/SQL block?

From: Antonio Sant <asant_at_iol.it>
Date: Sun, 05 Mar 2000 16:28:51 GMT
Message-ID: <7Xvw4.72382$qv.728752@news.infostrada.it>

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

Original text of this message

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