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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to conditionally copy and then create it using SQL scripts

Re: How to conditionally copy and then create it using SQL scripts

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 10 Oct 2001 13:14:39 +0100
Message-ID: <3bc43bb7$0$234$ed9e5944@reading.news.pipex.net>


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_at_bj.bexcom.com> wrote in message
news:de83f985.0110100042.43dac84f_at_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.
Received on Wed Oct 10 2001 - 07:14:39 CDT

Original text of this message

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