2008 Jul 25 11:53 AM
Hi everyone,
When I use attribute fields of type string in a table and I define a foreign key for that table with a check table,
than there is no referential integrity for this relation.
The defined foreign key has nothing todo with the attribute-field, here is an example:
ZT01 (check table)
mandt (s_mandt, clnt,3)
pk1 (numc, 10)
description (string)
ZT02 (first referring table, which works fine).
mandt (s_mandt, clnt,3)
pk1 (numc, 10)
fk1 (z_id, numc, 10)
ZT03 (second referring table, with no referential integrity).
mandt (s_mandt, clnt,3)
pk1 (numc, 10)
fk1 (z_id, numc, 10)
description (string)
In both cases the foreign key gives an impliciet help screen with the correct values.
The only difference is the additional field description in table ZT03.
This results in a foreign key relation without referential integrity!
Why?
regards,
Jan
2008 Jul 28 7:24 AM
Hi Jan,
"The only difference is the additional field description in table ZT03.
This results in a foreign key relation without referential integrity!"
I guess this part of the definition answers the question
"When one table has a foreign key to another table, the concept of referential integrity states that you may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table".
Mohinder
2008 Jul 28 11:49 AM
Hi Mohinder,
Sorry, but I do not agree with that.
The field 'description' is part of the referring table.
As far as I know, both tables in a fk-relation can have each his own attributes/fields.
There are no restrictions on that level.
regards,
Jan