Orphaned Items Deletion

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Dec 15 02:50:19 CST 2003


on 12/15/03 2:27 AM, Ian Devaney at idevaney at mac.com wrote:

Hi Ian,

> I have 3 tables. People, Gifts and GiftLinks.
> 
> The GiftLinks table holds pointers to the other 2 tables so that gifts
> can be shared between People.
> 
> When I delete a Person, the giftLinks entries for that person are also
> removed (kvCascade).
> 
> Obviously, I don't want to delete the actual gifts for that person in
> case they are shared by others.

> How would I construct a query to check if the gifts are still required
> or whether they have been completely orphaned by the removal of 1
> person.
> 
> I'm sure this should be straightforward but I'm a bit brain-dead at the
> moment.

I think you simply can do NOTHING.

If you delete Person, yes, giftLinks entries for that person are also
removed (kvCascade).

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


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.



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list