Re: Constraint naming conventions

From: Chris Fischer <cfischer_at_nando.net>
Date: 1996/05/01
Message-ID: <4m7um7$760_at_castle.nando.net>#1/1


chuckh_at_dvol.com (Chuck Hamilton) wrote:

>I'm looking for suggestions for constraint naming conventions.
>Especially for foreign keys. If there's a standard that's widely used
>in other Oracle shops, I'd like to here about it.

Let me give an example

ORDER table



ord_id NUMBER(7)
cust_id NUMBER(10)

CUSTOMER table



cust_id NUMBER(10)
cust_name VARCHAR2(30)

We have a foreign key constraint on ORDER(CUST_ID) referencing CUSTOMER(CUST_ID). We call the constraint FK_CUST_ID_CUSTOMER. In other words, FK_"the field being constrained"_"the table that the foreign key points to".

+------------------------------------------------------------+
| Chris Fischer                           cfischer_at_nando.net |
| Sr. Systems Analyst                    Work: (919)676-0062 |
| Toys "R" Us                                                |
+------------------------------------------------------------+
Received on Wed May 01 1996 - 00:00:00 CEST

Original text of this message