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: Why doesn't this query work?

Re: Why doesn't this query work?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 12 Feb 2004 13:28:45 -0000
Message-ID: <402b7f8e$0$7074$ed9e5944@reading.news.pipex.net>


You cannot do DDL in PL/SQL directly, you will need to use dynamic sql. However it is typically a bad idea to create tables on the fly.

-- 
Niall Litchfield
Oracle DBA
Audit Commission UK
"DG" <necron1999_at_hotmail.com> wrote in message
news:eb556de4.0402120340.72117c5_at_posting.google.com...

> Hi, yes, I'm an Oracle newbie:
>
> When I run this query:
>
> declare
> thecount number ;
>
> begin
>
> select count(*) into thecount from user_tables where table_name = 'B';
> if thecount = 0 then
> create table B (theCol number);
> end if;
> end;
>
> I get this error:
>
> PLS-00103: Støtte på symbolet CREATE der ett av følgende var ventet:
> ....blah blah...
>
> why is this? When I change the statement in the "IF" block
> to..say..an Insert statement it works ok...
>
> HELP!
>
> Thank you
Received on Thu Feb 12 2004 - 07:28:45 CST

Original text of this message

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