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: Sun, 25 Jun 2006 06:06:35 -0400
Message-ID: <UPCdnepsM8iz_QPZnZ2dnUVZ_r2dnZ2d@comcast.com>

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:fm9s92pbvf3ug3heqai0r6ejhn32covt9f_at_4ax.com...
: On Sat, 24 Jun 2006 16:05:39 -0400, "Mark C. Stock" <mcstockX_at_Xenquery
: .com> wrote:
:
: >Sybrand, have you guys every heard of installation scripts?
:
: What do you take me for?
:
: --
: Sybrand Bakker, Senior Oracle DBA

We won't go there ;-)

Seriously, the OP's question was simply how to handle ORA-00955 in a script.

This is a real-life issue for any DDL deployed to any environment -- i.e., handling DDL errors.

Since SQL*Plus has no error handling (other than 'panic and quit'), the DDL has to wrapped in some procedural language to handle the errors.

PL/SQL is a logical choice (the old 'why reinvent the wheel' argument -- it's in the database, use it). This is what we do to deploy to test and production environments to ensure clean installations and provide an audit tail for the auditors.

And, yes the OP didn't explicitly describe installation, upgrade, and/or deployment scripts. But the point is that DDL in PL/SQL is not inherently evil. At runtime in a production system, it most often is, but not across-the-board.

++ mcs Received on Sun Jun 25 2006 - 05:06:35 CDT

Original text of this message

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