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: DROP tables in PL/SQL

Re: DROP tables in PL/SQL

From: William Robertson <william.robertson_at_bigfoot.com>
Date: 29 Nov 2005 03:44:27 -0800
Message-ID: <1133264667.708384.114060@o13g2000cwo.googlegroups.com>


mlachajczyk_at_reporter.com.pl wrote:
>
> CREATE OR REPLACE PROCEDURE usun_xxx as
> Begin
> if EXISTS (select * from user_objects where object_name = 'xxx') then
> begin
> drop table xxx;
> end
> End;
>
> [snip]
>
> where did I make a mistake, in syntax or in consistence?

There is no "IF EXISTS" syntax in PL/SQL.

Also it is generally not a good idea to create/alter/drop tables within a stored procedure. What is the business requirement? Could it not be implemented using partitions of a permanent table? Received on Tue Nov 29 2005 - 05:44:27 CST

Original text of this message

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