Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

referential integrity delete cascade

Status
Not open for further replies.

diablozx6

Programmer
Dec 23, 2002
1
ZA
Hi.
First time here. Need help with referential integrity on Paradox 7 using Database Desktop. According to all help files I can find setting the update rule in Database Desktop to cascade should delete all related records in the child table. Whether setting the rule to cascade or prohibit makes no difference. Trying to delete a record in the master table I get this message:
Master has detail records. Cannot delete or modify

How do you get the cascade rule to work, deleting all records in the child table? How can I change the error message displayed to the user?
I would much appreciate any help.
Thanx
 
hello,

Paradox does not know a cascading delete. The cascade settings are only for updates.

regards
hans schoutsen
 
diablozx6,

Hans is correct; Paradox does not support cascading deletes using its referential integrity. Because this operation involves deleting records from the tables, a design decision was made to support that type of operation only through code, meaning you'd know it was being done and would therefore be reponsible if the wrong records were accidentally deleted.

Having said that, you can implement cascading deletes using queries.

Here's an example from one of the DBDEMOS sample tables:


Code:
   delete from
      "items.db"
   where
      "OrderNo" = "-1"

You'll want to replace the "-1" with the linking value for the master record and you'll need a query for each RI rule currently in effect.

Now Database Desktop is not the full Paradox package, so you won't be able to automate the process from it; however, I suspect you have another tool you can use to add that level of functionality, e.g. Delphi, C++ Builder, or even JBuilder.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top