Board index » delphi » Cascading Deletes

Cascading Deletes

I am curious how Delphi 3 C/S handles cascading deletes.
i.e. Suppose we have a classic Orders and Order Details group of
tables. If I delete a specific order from the Orders table, there will
be bad records in the OrderDetails table (those order details refering
to the order that was just deleted)

How does Delphi prevent this database corruption?

 

Re:Cascading Deletes


Quote
>I am curious how Delphi 3 C/S handles cascading deletes.
>i.e. Suppose we have a classic Orders and Order Details group of
>tables. If I delete a specific order from the Orders table, there will
>be bad records in the OrderDetails table (those order details refering
>to the order that was just deleted)

>How does Delphi prevent this database corruption?

Delphi doesn't prevent it.  If the database you are using does not prevent it
you will have to program this capability.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Cascading Deletes


Hi,

You should define a referential integrity between the two tables.
Then You can not delete the master record.
But You'll have to write Your own code to cascade deletes, if
I'm not mistaken...

Anyway, it would be the BDE, not Delphi, that is enforcing
referential integrity.

Thomas

-----------------------------------------------------------------
Thomas Schimming
EPFL: Ecole Polytechnique Federale de Lausanne
CH-1015 Lausanne, Suisse
email: Thomas.Schimm...@epfl.ch
www: http://circwww.epfl.ch/~schimmin/
-----------------------------------------------------------------

Other Threads