Sorry, my mistake, I meant, the tables has an ID generated, PersonID to
reference a person table and a telephone field. When I created the FK to map
to person table, I was expecting the database to check for missing personID.
After all, if the FK works when you insert a record with a personID that
does not exist, why doesn't it work when you do not supply a personID. I
understand your concept, but shoudn't this be the database's responsibility
to reject a null personID if a FK is in place? after all, a null or empty
personID does not map to anything on the person table. Also when I run your
query example I still get 0 rows affected. I could use the keys to remove
them, but it is strange that I can not delete those records that were
created without a personID. Are they empy or null? in other languages
sometimes there is a difference.

This is the query I used.
delete from pkgAddressBook.Tlphones where personID is null
Thanks.

"kevin furze" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> you do not need the Field1 - "ID"
> Cache automatically creates ID for any permanent storage.
> so in your case, just create
> Field1 = PersonID Foreign Key References PhoneBook.Person
>
> when trying to delete  entries that do not have a phone number try:
> delete from pkgAddressBook.Tlphones where personID is null
>
> the concept is fine in theory, but as you can imagine, having a single
> field in the DB that is not mandatory is a bit strange.
>
> kev
>
>



Reply via email to