If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > Referential constraints / cascade delete operation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-11-04, 02:52
posk posk is offline
Registered User
 
Join Date: Jan 2004
Location: Poland
Posts: 3
Question Referential constraints / cascade delete operation

I have a problem with referential constraints.

Situation is quite obvious:
Master table Person - keyed by ID field
detail table, for example, Phones, joined with 'Person' by
Phones.IDPerson -> Person.ID (by lookup table - and it works perfectly).
But - when I want to delete a person-record, I want all Phones record joined with this Person to be removed automatically (simple Cascade
update rule).

And here's a problem: By Database Desktop I can set UpdateRule to Cascade; but it looks as it works only for updates; i still can't delete Master record. Also, in SQLExplorer, in referencial constraints, i have "Modify operation" set to 'cascade', but 'Delete operation' is still set to 'Restrict' - and i can't change it.

Is any solution of this problem - or maybe, is any better utility for creating, managing, etc. Paradox Databases than Database Desktop?

Thanks for any help

Kuba Poskrobko
posk@o2.pl
Reply With Quote
  #2 (permalink)  
Old 02-11-04, 10:26
lmckelvy lmckelvy is offline
Registered User
 
Join Date: Oct 2003
Posts: 107
Cascade deletes are not supported by Paradox/BDE. You have to do them programatically.

If the relational database is constructed properly, you would simply do delete queries based on the key values of the record set you are trying to delete.
Reply With Quote
  #3 (permalink)  
Old 02-12-04, 03:37
posk posk is offline
Registered User
 
Join Date: Jan 2004
Location: Poland
Posts: 3
Thanks very much for answer - I haven't found it in documentation (maybe i haven't looked for it enough deeply).

I know that programically it works (i've already developed it); but i've a simple database with few tables - and every of them is connected with another; and is accessed from many points.

Thanks one more time for answer.
But i have another (connected with previous one) question: is any (can be commercial - but quite cheap and simply) DB engine that provides full referencial constraints? (i know that for example MSSQL does it) - maybe full Paradox also is able to perform it?

Thanks for any help

Kuba Poskrobko
posk@o2.pl
Reply With Quote
  #4 (permalink)  
Old 02-12-04, 08:57
lmckelvy lmckelvy is offline
Registered User
 
Join Date: Oct 2003
Posts: 107
I'm only familiar with Paradox, so I'll leave that question to someone else. I'm sure Oracle will do it, but that's like killing an ant with a sledge hammer.
Reply With Quote
  #5 (permalink)  
Old 05-20-04, 06:30
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
Many referential db engines provide full cascade delete, but any db which supports triggers can be turned into providing such capability, since full cascade delete is only a set of delete queries triggered by a delete in the main table.

By the way, the limit to FCD is in the BDE, so even the full Pdox has this limit.

Since there are many situations in which you DON'T want the cascade delete, i've always preferred doing this by code, rather than by referential integrity.

bye!
__________________
The only failure is not trying to do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On