Path: news.easynews.com!easynews!cyclone2.usenetserver.com!usenetserver.com!news-hub.cableinet.net!blueyonder!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mail
From: "Niall Litchfield" <n-litchfield@audit-commission.gov.uk>
Newsgroups: comp.databases.oracle.server
References: <de83f985.0110100042.43dac84f@posting.google.com>
Subject: Re: How to conditionally copy and then create it using SQL scripts
Date: Wed, 10 Oct 2001 13:14:39 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Lines: 40
Message-ID: <3bc43bb7$0$234$ed9e5944@reading.news.pipex.net>
NNTP-Posting-Host: host9.audit-commission.gov.uk
X-Trace: 1002716087 reading.news.pipex.net 234 193.128.236.219
X-Complaints-To: abuse@uk.uu.net
Xref: easynews comp.databases.oracle.server:120799
X-Received-Date: Wed, 10 Oct 2001 06:36:47 MST (news.easynews.com)

What is wrong with just issuing

 DROP TABLE BusinessDocIdGenerator;
 CREATE TABLE BusinessDocIdGenerator (
        NumericGeneratorId   int NULL,....);

Sure you'll get a message that the table doesn't exist if it doesn't but who
cares?

actually you'll also get a message that int isn't a valid datatype as well.


--
Niall Litchfield
Oracle DBA
Audit Commission UK



"zl" <lzhang@bj.bexcom.com> wrote in message
news:de83f985.0110100042.43dac84f@posting.google.com...
> In SQL server, the following SQL statements can be used to create a
> table if it is not existed.
>
>
> IF EXISTS  (SELECT * FROM sysobjects
>                                WHERE name = 'BusinessDocIdGenerator'
>                                        AND type = 'U')
>            DROP TABLE BusinessDocIdGenerator
>
> CREATE TABLE BusinessDocIdGenerator (
>        NumericGeneratorId   int NULL,
>        .....
> )
>
>
> How can I do this in Oracle? Oracle doens't allow "if" appears in
> sqlplus.


