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: Rename a constraint

Re: Rename a constraint

From: Johan Thorselius <johan.thorselius_at_outright.se>
Date: Thu, 07 Jan 1999 00:02:36 +0100
Message-ID: <3693EB8C.BF436879@outright.se>


You need to parse and look at the results set from a select from USER_CONSTRAINTS. Yes, it's stupid but Oracle does not give you any help if you let Oracle pick the constraint name (SYS_x). And an even worse design issue - you cannot alter a column constraint, you first have to drop the old one and create a new one. And then you also first have to find the constraint name SYS_x. Not good design by Oracle.

Johan Thorselius

Syarzhuk Kazachehnka wrote:

> gennick_at_worldnet.att.net wrote:
> > >Is there a way to rename a constraint in Oracle using SQL ? I need
> > >to rename the system generated constraint to a different name.
> >
> > No. You need to drop and recreate the constraint.
> How do I retrieve the name of a system generated constraint? I have a table
> created with:
> CREATE TABLE Tablename(
> ...,
> FieldName VarChar(50) UNIQUE,
> ...
> );

>

> I need to get rid of the UNIQUE constraint but can't find the way to get the
> constraint name out of the system.
>

> Sincerely,
>

> Syarzhuk
>

> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Received on Wed Jan 06 1999 - 17:02:36 CST

Original text of this message

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