Subject How to get the DB to see a Deletion then add a Foreign Key constraint?
Author Chuck Belanger
Hello:

In my desktop application, I'm datapumping as part of an update process
for the user's database. At the beginning of the update process I drop
all constraints and at the end I add them all back. During the debugging
I found that a number of records were datapumped in a particular table
that had foreign key violations because of non-existence in the related
table. No problem, I added a routine to delete all records that did not
have a corresponding record in the related table. But here's the
problem:

When I try to add the FK constraint back, I get the same error message
as though the deletion never took place. I can add the FK constraint if
I Disconnect and then Connect, but this seems like way overkill!

I have a BeginBusy/EndBusy and Transaction.Commit at the end of the DSQL
Delete, but this is not enough. What am I missing here to really make
sure the transaction is committed and available to the DB so that it no
longer sees these FK violations?

Thank you for your help,

Chuck Belanger