Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to conditionally copy and then create it using SQL scripts
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...Received on Wed Oct 10 2001 - 07:14:39 CDT
> 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.