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 -> Cant see my error in SQL

Cant see my error in SQL

From: JaffaB <jaffa_brown_at_yahoo.co.uk>
Date: Tue, 04 Sep 2007 09:16:57 -0700
Message-ID: <1188922617.963119.85200@57g2000hsv.googlegroups.com>


Hi all,

I have been looking at this script for days - just cant see where the error is. In my script, I have the following logic (does the table exist, if not, create it)....

bk number(30);
PCID number(10);
begin
select count(*) into bk from ALL_TAB_COLS where table_name='YourLocalTempTable';
  if bk=0 then
  begin
   CREATE TABLE "YOURLOCALTEMPTABLE" <------- * * * Error Line * * * *

   ("ID" NUMBER,
"PARENTID" NUMBER,
"ARTICLEID" NUMBER,

    etc....

However, when I try to compile it (Ora 10g), get the error...

 Line # = 13 Column # = 4 Error Text = 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

Please, somebody take me out of this madness and tell me what is wrong with my script.

Many tahnks in advance. Received on Tue Sep 04 2007 - 11:16:57 CDT

Original text of this message

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