Not true
from v5r4 manual:
Let T2 denote the identified parent table.
(column-name,...)
The parent key of the referential constraint is composed of the identified columns. Each column-name must be an unqualified name that identifies a column of T2. The same column must not be identified more than once. The column must not be a LOB or DATALINK column. The number of identified columns must not exceed 120, and the sum of their lengths must not exceed 32766-n, where n is the number of columns specified that allow nulls.
The list of column names must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2. The names may be specified in any order. For example, if (A,B) is specified, a unique constraint defined as UNIQUE (B,A) would satisfy the requirement. If a column name list is not specified then T2 must have a primary key. Omission of the column name list is an implicit specification of the columns of that primary key.
The specified foreign key must have the same number of columns as the parent key of T2. The description of the nth column of the foreign key and the nth column of the parent key must have identical data types, lengths, and CCSIDs.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----midrange-l-bounces@xxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: Tommy.Holden@xxxxxxxxxxxxxxxxxxxxx
Sent by: midrange-l-bounces@xxxxxxxxxxxx
Date: 12/14/2009 04:32PM
Subject: Re: Constraints, anyone?
you do not have to add a primary key constraint to a table if it is
already uniquely keyed. RI constraints are *not* dependent on whether a
"master" file is uniquely keyed or not, just that the key value written to
the "detail" file has a matching key in the "master" file
Thanks,
Tommy Holden
From: "James H. H. Lampert" <jamesl@xxxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 12/14/2009 03:26 PM
Subject: Re: Constraints, anyone?
Sent by: midrange-l-bounces@xxxxxxxxxxxx
Tommy.Holden@xxxxxxxxxxxxxxxxxxxxx wrote:
primary key = unique keyed PF
So why is it available as a constraint, as opposed to simply creating
the PF as keyed? And conversely, assuming the PF is already keyed, is it
necessary to add a primary key constraint to the file in order to use it
in referential constraints?
--
JHHL
As an Amazon Associate we earn from qualifying purchases.