problem with deletions using binary link

Dave Parizek david at parizek.com
Thu Jun 28 19:25:02 CDT 2007



I have 2 tables linked 1:M via binary links with deletion control set  
to CASCADE:

query = @"CREATE BINARY LINK thisLInk ON TABLES (OneTable, ManyTable)  
AS ONE TO MANY ON DELETE CASCADE";
[mDatabase sqlExecute:query];


If I delete several (but not all) records in the many table, nothing  
happens in the one table, as expected.

But if I delete the last record, or all the records, in the many  
table, then some records disappear from the one table, even though  
they should not.


The above is in my app.  But if I open the same database, in the same  
state, in VStudio, and perform the same deletions, I do not lose any  
records from one table, even if I delete all records from the many  
table.

I can see nothing I am doing wrong as far as the deletions - I am  
using sql statements - "DELETE FROM theManyTable WHERE RecID =  
aRecID", deleting the records one at a time.

I never at any time say to delete any records from ONE table.

Do I need to unlink or something before deletion?  I thought that was  
handled automatically...

Any ideas?  I am uncertain as to how to even try to debug this...

--Dave



More information about the Valentina mailing list