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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Create a table only if the table doesn't exists

Re: Create a table only if the table doesn't exists

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Thu, 22 Jun 2006 12:55:56 -0400
Message-ID: <qYCdncjEafcAVgfZnZ2dnUVZ_t6dnZ2d@comcast.com>

"fred" <r5tr_at_free.fr> wrote in message
news:e7egsu$598$1_at_s1.news.oleane.net...
: Hello,
:
: I want to write a sql script that creates a table only if the table
doesn't
: already exists (but if the table creation fails for another reason than
: "table already exists" I want to know about it).
: Is it possible to do that in sql only or is pl/sql needed ?
: If needed, how do you do that in pl/sql ?
:
: Thanks a lot for your help.
:
: Fred.
:
:

i'm assuming you are using SQL*Plus to run a script.

SQL*Plus does not do conditional processing based on SQL Errors -- however it does have a WHENEVER SQLERROR command that may be of some use to you

in PL/SQL, you want EXECUTE IMMEDIATE

depending on your OS and/or OS utilities, you can always filter out the ORA-00955s from your output file

++ mcs Received on Thu Jun 22 2006 - 11:55:56 CDT

Original text of this message

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