So you're passed the SRTSEQ problem and are encountering a problem with the
field not being unique or primary key at the table level.
Your CREATE TABLE statement in the other post doesn't show DMCATMST table
and that's where the problem is now.
Column CTCODE must be either primary key or unique constraint at the
DMCATMST table level or alternatively there has to exist a unique index on
it.
Elvis
Celebrating 10-Years of SQL Performance Excellence
http://centerfieldtechnology.com/training.asp
-----Original Message-----
Subject: RE: Foreign key constraint problem
Did that. Then I get this in the joblog:
Message ID . . : CPD32B0 Severity . . . : 20
Message type . : Diagnostic
Date sent . . : 05/31/07 Time sent . . : 16:03:28
Message . . . . : Constraint is not valid.
Cause . . . . . : Constraint CATALOGFK cannot be added for file DMITMMST
in library JEFF for TYPE value *REFCST. For a referential constraint (TYPE
*REFCST), the parent file DMCATMST in library JEFF has a delete rule of
*RESTRICT and update rule of *RESTRICT. The constraint was not added because
of errors. The reason code is 12. The reason codes and their meanings are as
follows:
<snip>
12 - The parent key does not exist.
<snip>
Recovery . . . : Do one of the following based on the reason code shown,
and then try the request again.
<snip>
12 - Add primary key or unique constraint (ADDPFCST) to parent file.
The parent file's unique key is field CTCODE, which is the field I'm
referencing.
As an Amazon Associate we earn from qualifying purchases.