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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Can a Stored Proc DROP a table?

Re: Can a Stored Proc DROP a table?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/06/08
Message-ID: <960526180.961.1.pluto.d4ee154e@news.demon.nl>#1/1

You need to use the dbms_sql package for this in Oracle 7 and 8.0 and execute immediate in Oracle 8i.
Hth,

Sybrand Bakker, Oracle DBA

Sean <dolans_at_my-deja.com> schreef in berichtnieuws 8houfs$gbl$1_at_nnrp1.deja.com...
> I would like to create a stored procedure that when called, drops a
> table and then recreates it. Can a stored procedure accomplish this?
> I have tried the statment DROP table tbl_test; in my PL/SQL code, but
> it gives me an error.
>
> Any ideas?
>
> Thanks,
> Sean
>
> CODE:
> ------------
> CREATE OR REPLACE PROCEDURE SP_TEST
> (intSuccess OUT NUMBER)
> IS
> BEGIN
> drop table test;
> intSuccess := 1;
> END;
> /
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Jun 08 2000 - 00:00:00 CDT

Original text of this message

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