Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: DROP tables in PL/SQL
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
![]() |
![]() |