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: Mon, 05 May 2003 10:47:32 -0400
Message-ID: <46ucbv0hq9gsihs1n53rsjami9a8l65amm@4ax.com>


On Thu, 01 May 2003 08:23:58 -0700, Daniel Morgan <damorgan_at_exxesolutions.com> wrote:

>My feeling is about constraint names is that they should have meaning when you
>get a message from an end-user, or from a record in an error log table, that says
>that the constraint has been violated.

I don't think it's best practice to pass constraint names to the user.

Using abbreviations is a work-around for unreasonable constraints (cough) on the length of constraint names. I don't know what the SQL standard says about that; I do know that Mimer SQL allows 128 characters in a constraint name.

But I don't want the user to see either a short, cryptic, encoded constraint name /or/ a 128-character constraint name. I want the user to see something they can communicate easily and reliably to another human. IME, users communicate error numbers more easily and reliably than anything else. And, IME, users have less trouble with multiple four-digit numbers than with long numbers. (They communicate 1234-5678-9012 more easily and more reliably than 123456789012.)

So, in practice, I use either a table or a text file to map error numbers to constraint names. Then I write a couple of programs to generate constraints and *.h files (or whatever I need) from the table.

-- 
Mike Sherrill
Information Management Systems
Received on Mon May 05 2003 - 09:47:32 CDT

Original text of this message

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