[V4RB] ? about cascade deletion and many to many relationship

Kevin Windham kevo at gatorgraphics.com
Thu Feb 6 13:08:37 CST 2003


On Thursday, February 6, 2003, at 12:37  PM, Claudius Sailer wrote:

> Am Donnerstag, 06.02.03 um 19:18 Uhr schrieb Kevin Windham:
>
>> Say I have a link table  t12 with t1.ptr and t2.ptr so I have a many 
>> to many relation between t1 and t2.
>>
>> Now when I delete a record  t1 I want the associated link records in 
>> t12 to be deleted, but I don't want the associated records in t2 to 
>> be deleted.
>>
>> If I understand the Cascade option correctly, it will delete records 
>> in t2 also. Is that correct, and if so how would I go about handling 
>> this situation? If I am wrong, can someone tell me how to set up the 
>> deletion properly.
>
> I would say now.
>
> You define in t12
>
> kv_Cascade
>
>
> in t2
>
> kv_SetNull
>
>
> then in t12 the records will be deleted in t2 the field in the records 
> will be set to null.
> The delete-functionality tells the relation by itself how it should 
> act when the BasisRecords is deleted
>

I don't think that will work. I don't have an VobjectPtr field in t1 or 
t2, only in t12. There is nowhere to set kv_SetNull in t2. Or am I 
missing something?

Kevin



More information about the Valentina mailing list