Orphaned Items Deletion

Ian Devaney idevaney at mac.com
Wed Dec 17 08:11:33 CST 2003


On 17 Dec 2003, at 5:28 am, valentina-request at lists.macserve.net wrote:

> But Gift(s) itself will not be deleted in any case.

I know.

> What is your task?
> If a gift is used only by ONE person, and we delete person,
> Gift still must be here? Then you will get this doing nothing.

If a gift is share by 2 people then evrything is OK. The deletion of 
either person deletes no gifts and so the shared gift is still 
available to the other person.

However, if a gift is NOT being shared, deleting the person who "owns" 
the gift will leave an "orphaned" gift in the database.

After any person deletion I need a query that says:

"find me any gifts whose pointer in the giftLinks table now points to 
people who don't exist"

so I can delete these gifts.

Thanks,

Ian



More information about the Valentina mailing list