Path: news.easynews.com!easynews!sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
From: lzhang@bj.bexcom.com (zl)
Newsgroups: comp.databases.oracle.server
Subject: How to conditionally copy and then create it using SQL scripts
Date: 10 Oct 2001 01:42:09 -0700
Organization: http://groups.google.com/
Lines: 17
Message-ID: <de83f985.0110100042.43dac84f@posting.google.com>
NNTP-Posting-Host: 202.106.167.197
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1002703329 885 127.0.0.1 (10 Oct 2001 08:42:09 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 10 Oct 2001 08:42:09 GMT
Xref: easynews comp.databases.oracle.server:120776
X-Received-Date: Wed, 10 Oct 2001 04:33:49 MST (news.easynews.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.
