Re: Stored Procedures

From: Michael Hall <michaelchall_at_email.msn.com>
Date: Tue, 14 Sep 1999 20:43:46 -0500
Message-ID: <OKK4avx$#GA.288_at_cpmsnbbsa03>


Steven,

You must use SYS.DBMS_SQL in order to execute DDL from within a stored procedure.

Mike

Steven R Fuller <srfuller_at_doitnow.com> wrote in message news:37DEDC48.B8AEDFAC_at_doitnow.com...
> Ok , Let me clarify my stored procedures questions.
>
> When I execute a create or replace procedure, I get a procedure created
> with compilation errors,
>
> However when I break out the individual code ie:
>
> drop table s_emp
> ;
>
> Create table s_emp
> (
> FName VARCHAR2(25)
> ,LNAME VARCHAR2(25)
> )
> ;
>
> INSERT INTO S_EMP
> (FNAME, LNAME)
> VALUES('JOHN', 'DOE')
> ;
>
> This works fine
>
> When I create a proc like this I get an error
>
> create procedure emp_load
> is
> Begin
> drop table s_emp
> ;
>
> Create table s_emp
> (
> FName VARCHAR2(25)
> ,LNAME VARCHAR2(25)
> )
> ;
>
> INSERT INTO S_EMP
> (FNAME, LNAME)
> VALUES('JOHN', 'DOE')
> ;
>
> end emp_load;
>
> NOW I GET THE ERRORS
>
Received on Wed Sep 15 1999 - 03:43:46 CEST

Original text of this message