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

Home -> Community -> Usenet -> c.d.o.misc -> Re: whenever sqlerror is an unknown statement?

Re: whenever sqlerror is an unknown statement?

From: <jjsavage_at_gmail.com>
Date: 20 Jan 2006 11:28:38 -0800
Message-ID: <1137785318.738547.158060@f14g2000cwb.googlegroups.com>


My overall goal is to create a table iff it doesn't exist. After more poking around the docs, I've got this:

begin

   select * from all_tables where table_name = 'foo';    exception
   when no_data_found then
   begin

      create table foo(bar char(5));
   end;
end;

And SQL Workshop says:
 m
ORA-06550: line 6, column 4: PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe

Bah! Why can't I have a create, but I can have a select or update or anything else?

Received on Fri Jan 20 2006 - 13:28:38 CST

Original text of this message

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