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: naming conventions for constraints

Re: naming conventions for constraints

From: Mike Sherrill <MSherrill_at_compuserve.com>
Date: Thu, 01 May 2003 07:41:43 -0400
Message-ID: <6112bv817en94osqrj0nrbg3qc6lqqvbpt@4ax.com>


On Wed, 30 Apr 2003 14:00:41 +0200, "Sönke Petersen" <sk.petersen_at_gmx.de> wrote:

>after studying some documents on naming conventions the main recommendations
>for constraints seem to be that constraints should be named as the table it
>is applied to, followed by a suffix which identifies its type.
>
>table name: systems
>
>possible constraint names could be:
>
>systems_pk --> primary key constraint
>systems_fk --> first foreign key constraint
>systems_fk2 --> second foreign key constraint
>
>A second approach could be to apply the column name as well:
>
>systems_id_pk --> primary key constraint
>systems_hostname_fk --> foreign key constraint

I try to name constraints according to their underlying logic. Their full name consists of the table name, column name, and logical purpose. I use a table of transformations to manage abbreviations of all three of these. So the full name of a constraint might be

 parties_fullname_required

and that might abbreviate to

 p_fullname_reqd

-- 
Mike Sherrill
Information Management Systems
Received on Thu May 01 2003 - 06:41:43 CDT

Original text of this message

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