Grass Cake wrote:
I'm still unsure about foreign keys..even after reading the doc file and
Paul Dubois 3rd edition

My doubt is...how much constraint is applied.....( probably a bad
explanation)

If i have a table 'Customers' with the primary key being 'CustID'

Then i have a table 'LastVisit' with a foreign key 'CustID'

btw...i have a Form-SubForm in OO that i'm working with where i have the 2
tables linked

should the foreign key 'LastVisit.CustID' only allow values that are in the
linked primary field? or will it allow any value that is in the table '
Customers.CustID' ?

When i enter any value that doesn't exist in the 'Customers.CustID' column i
get the ref. integrity error...BUT i want it
to kick ANY value that doesn't relate to the linked parent table out as an
error.

It will check to make sure the CustID value is in the Customers table.

If it's not there, then it will give you an error.

If it is there, the insert/update will work fine.

It has no way of knowing if you are inserting the right record, all it
cares about is that the CustID value is in the other table.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to