| 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
zl wrote:
>
> 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.
You have to use PL/SQL and dynamic SQL. See the docs.
-- Ron Reidy Oracle DBA Reidy Consulting, L.L.C.Received on Wed Oct 10 2001 - 06:27:05 CDT
![]() |
![]() |