Orphaned Items Deletion

Gregoire William wgregoire at paris.mediagerance.com
Wed Dec 17 14:15:32 CST 2003


DELETE FROM giftTable WHERE NOT( IdPerson IN (SELECT IdPerson FROM
PersonTable) )

no?

WilG

> -----Message d'origine-----
> De : valentina-bounces at lists.macserve.net
> [mailto:valentina-bounces at lists.macserve.net]De la part de Ian Devaney
> Envoye : mercredi 17 decembre 2003 14:12
> A : valentina at lists.macserve.net
> Objet : Re: Orphaned Items Deletion
>
>
>
> 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
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list