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: ATTN: VSATYA RE:Help on Data Integrity Constraints ATTN: VSATYA

Re: ATTN: VSATYA RE:Help on Data Integrity Constraints ATTN: VSATYA

From: Paul <paulsnewsgroups_at_hotmail.com>
Date: Thu, 12 May 2005 14:26:24 +0100
Message-ID: <a5m681h74vv1fmjlcrj15dkev8keninp02@4ax.com>

"Matt" <none_at_anon.com> wrote:

>VSATYA,
> Foreign key on Status referencing MasterAISTATUS(Code) <---so long as the value is in the column it will be added
> Foreign key on Gender referencing MasterSex_table(Code) <---so long as the value is in the column it will be added
> Foreign key on Designation referencing MasterRoll_table(Desc) <---so long as the value is in the column it will be added

Please don't top-post.

Using a Foreign key constraint on a Gender table is just silly - use a check constraint. You can get skewed indices which can slow things down a lot - same goes for any "binary" value like AISTATUS - check constraint again.

I don't know what my rule of thumb would be, but bascially if you are *_EVER_* going to add to a list of values, use a table and foreign key constraint, but with something like Gender which will *_NEVER_* have any values other than M or F, then use a check constraint.

Paul...

-- 

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2, 

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.2.0;

When asking database related questions, please give other posters 
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't work!").
Thanks.
 
Furthermore, As a courtesy to those who spend 
time analyzing and attempting to help, please 
do not top post.
Received on Thu May 12 2005 - 08:26:24 CDT

Original text of this message

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