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 -> Newbie: Help please !

Newbie: Help please !

From: andy sykes <andrew.sykes_at_holland.sun.com>
Date: Fri, 07 Aug 1998 16:42:33 +0200
Message-ID: <35CB1259.CE363145@holland.sun.com>


What's wrong in this anonymous block ? When I run this in sqlplus it complains at the "drop table" line with :

ERROR at line 1:

ORA-06550: line 9, column 3:
PLS-00103: Encountered the symbol "DROP" when expecting one of the
following:

begin declare exit for goto if loop mod null pragma raise return select update while <an identifier> <a double-quoted delimited-identifier> etc.

If I am doing this in a stupid way then please tell me.

Thanks in advance.  

declare

        nrecs number ;
begin

        select count(*)
        into nrecs
        from user_tables
        where table_name = 'ts_user' ;
        if nrecs > 0 then
                drop table ts_user ;
        end if ;
        create table ts_user (
        user_id char(15) ,
        user_name varchar(30) ) ;

end ;
/ Received on Fri Aug 07 1998 - 09:42:33 CDT

Original text of this message

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