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

Home -> Community -> Usenet -> c.d.o.server -> Re: executing a list of DDL statements in one call

Re: executing a list of DDL statements in one call

From: Mark Malakanov <markmal_at_sprint.ca>
Date: Tue, 15 Jun 1999 22:47:34 +0700
Message-ID: <kFt93.153234$r_1.29469286@newscontent-02.sprint.ca>


If you only need automatically execute several DDL you can simply use script (text file):

myscript.sql



create table T1...;
create table T2...;
...
create or replace....;
<EOF>

You can execute this script from SQL*Plus SQL> @myscript.sql

If you need create several objects in one step (all or nothing) you can use CREATE SCHEMA construction.

If you want to create different objects in each execution of the _procedure_, use dinamic SQL (DBMS_SQL package )

Regards,
Mark

Jerwynn wrote in message <3765C351.9754B8A2_at_i-manila.com.ph>...
>Hi,
>
> I need to execute several DDL statements, specifically CREATE OR
>REPLACE FUNCTION command (which is read from a file). PL/SQL begin ...
>end doesn't allow DDL statements inside.
>Is there another way to run the DDL statements in one call?
>
> Oracle has a CREATE PACKAGE command, which can contain several
>functions. However, I want my FUNCTIONS to be created in the
>top-level. Thanks.
>
>Regards,
>
>Jerwynn Lee
>
Received on Tue Jun 15 1999 - 10:47:34 CDT

Original text of this message

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