Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: rename foreign keys from system-assigned constraint names to more

Re: rename foreign keys from system-assigned constraint names to more

From: sundeep maini <>
Date: Wed, 08 Aug 2001 16:45:41 -0700
Message-ID: <>

A script for those who don't use Designer or modeling or didn't reverse eng. existing DBs into a Design tool. You get pretty good names automatically when you translate your models into schemas along with many other benefits obviating the need for such scripts.

Also, if you are relying on constraint names for your error correction may be you should also look at using Exceptions table(s) for capturing constraint violations and reporting details from a join of the Exceptions table with all_costraints to report what is meaningful about the constraint. You will be woefully limited to construct or guess all the details from a 30 char long name with FK_ prefixed or suffixed.

Designer gives you fairly reasonable names but if you are generating a report for violations in your code you need to look beyond the name. You can report all the meaningful details from one of the constraint views.

I am not casting any aspersions here but many DBAs I have worked with tend to take a abstruse and techie route to everyday problems. In most environments you should have rigourous integrity checking and mostly such violations should be reported to both IS and concerned business managers to address underlying issues. I digress but the key thing is to have business terms used for entities and attributes and have a solid catalog of meta data. The schema terms automatically follow these business terms upon data transformation. When you generate error reports from such a schema the details make all the sense to all the readers. I tend to disagree using constraint names to convey such meaning.

Whew! where was I ...

Sundeep Maini
Currently on Assignement at Marshfield Clinic WI

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
Please see the official ORACLE-L FAQ:
Author: sundeep maini

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
To REMOVE yourself from this mailing list, send an E-Mail message
to: (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 08 2001 - 18:45:41 CDT

Original text of this message