Drop table/view

From: Guido vd Zweerde <GVDZ_at_dlep1.itg.ti.com>
Date: 1996/12/11
Message-ID: <01bbe74d$600ec7a0$77025982_at_civ002119.civ.utwente.nl>#1/1


[Quoted] [Quoted] I'm trying to write a PL/SQL procedure to drop tables/views. The purpose is to drop
[Quoted] only when the object exists. I've already written a PL/SQL block to check if the object
exists, but when it exists and I tell it to drop the object it gives the next PL/SQL error message:
PLS-00103 Encountered the symbol "DROP" when expecting one of the following:
begin declare end exception exit for goto if loop mod null pragma raise return select update while <an identifier> etc. The code I have so far :

set serveroutput on
set feedback off
set verify off

--
define obj_name='&1'
begin
        declare
                name    all_objects.object_name%type;
                obj     all_objects.object_type%type;
        begin
                select  object_name
                ,       object_type
                into    name
                ,       obj
                from    all_objects
                where   object_name = upper ('&obj_name')
                and     object_type != 'SYNONYM';
                dbms_output.put_line ('existing');

/* Here I want to drop the object */
/* like : drop obj name; */
exception when no_data_found then dbms_output.put_line ('non existing'); end; end; / Who can and is willing to help me? Guido vd Zweerde Universiteit Twente
Received on Wed Dec 11 1996 - 00:00:00 CET

Original text of this message