Re: Primary Key on Column ?

From: Randy Dewoolfson <randyd_at_cais3.cais.com>
Date: 1995/11/27
Message-ID: <49bber$dmr_at_zippy.cais.net>#1/1


Gary Myers (101355.3556_at_CompuServe.COM) wrote:
: At table level, the key can comprise more than one column. For example an
: item may have a key of contract number, item number, and so should be defined
: at table level. The contract would have the key contract no which could be
: set at either column or table level. A single column primary key is normally
: faster, but I don't think it makes any difference if its done at table or column
: level. I'd define all keys at the table level for consistency purposes.
: Gary
: --
: Gary Myers, Analyst/Programmer, Kaisha Technology, West of England

Good point about multiple columns - otherwise the only difference is the syntax. The only result is the creation of a unique index on the column(s) specified.

Remember that you should also specify the storage clause for the index tablespace that you want to use as well as some sizing info - this pretty much makes you declare the whole darn thing at table level as opposed to column level. Also give the constraint a readable name instead of the lousy system generated index name - it'll help later.

Good Luck -
Randy :)

--
    ..uu.                                     ----------------------
  .?$" '?i     .                              I  Randy DeWoolfson  I
 .T^M  ._at_"    d9    .     f   ,.un.  b,    i  I--------------------I
 "  Z :#"    M `8   U    <  .dP"``"# `M   _at_"  I  randyd_at_cais.com   I
    &H?`    Xl _R   $5.  $  ?*    _at_   'P,#"   I--------------------I
  ,d#^*L   :RP'~$b  f`$L:M  Xf  .f'    dH`    I        ,\//.       I
    &  'M ,P    `E  M   "$  Mux~      n!`     I        |o o|       I
   dk   `h"       ' j     " y"       *~       I====oOO==(_)==Ooo===I
Received on Mon Nov 27 1995 - 00:00:00 CET

Original text of this message