Book a Demo

Author Topic: Additional Referential Integrity functionality  (Read 3574 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Additional Referential Integrity functionality
« on: October 29, 2007, 11:43:22 pm »
As EA struggles toward more complete Data Modelling capability, one thing which ought to be taken into consideration is extending the Referential Integrity group in the Foreign Key Constraints dialog.

Currently, there is support for the following:

Activity:
INSERT
  Parent Action: None
UPDATE
  Parent Action: None, Cascade
  Child Action: None
DELETE
  Parent Action: None, Cascade
  Child Action: None

The more complete set is:

INSERT
  Parent Action: None
  Child Action: None, Restrict, Set Null
UPDATE
  Parent Action: None, Cascade
  Child Action: None, Restrict, Set Null
DELETE
  Parent Action: None, Cascade, Restrict
  Child Action: None, Restrict

The definition for these concepts is quite well known, but for the sake of completeness:

Restrict (parent action):  Verifies the existence of child records and prevents deletion of the parent if any such children exist (the inverse of cascade delete).

Cascade:  Propagates any modification of a primary key value to the corresponding foreign key values in the child table.  Can also be used to propagate the deletion of the parent to the deletion of the child.

Set Null:  Verifies the existence of the foreign key values in the parent table’s primary key. If the values cannot be validated, the trigger sets the foreign key values to null in the child table and lets the data modification operation proceed

Restrict (child action):  Verifies the existence of foreign key values in the parent table’s primary key and prevents the insertion, or updating of data if the values cannot be validated.  On Delete, can be used to restrict the deletion if the cardinality of the relationship would fall below the minimum.

Thoughts?  Votes?
Paolo



« Last Edit: November 01, 2007, 03:32:27 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Additional Referential Integrity functionality
« Reply #1 on: October 30, 2007, 03:12:09 am »
Yes, I agree this area could be improved by completing the set.

Of course these settings would have to respect the capabilities of the individual DBMS (or engine in some cases).

In particular, I'd like to see these:
  • Available for the default <none> case. NB: Ability to set database to <none> previously requested - not yet implemented.
  • Configurable for user-defined DBMS products - i.e. whether the product will allow each given setting, and referential integrity dialog disabling prohibited settings.
David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Additional Referential Integrity functionality
« Reply #2 on: November 01, 2007, 03:32:05 am »
Quote
[glb]aught??[/glb]
I must admit I haven't found that one on http://www.freerice.com yet.

b    :P
OK,  So I used the wrong ought!   Of course by the "Cantoni Effect", it would get through the spell checker...

Interestingly, of course, aught is what we should be saying when we substitute (incorrectly) "Oh" (the letter) for "aught" (the cipher or Zero).  

Because I actually use the word aught in this way, I had a "slip of the brain" which wasn't caught by the spell checker, but should have been caught be the (non-existent) grammar checker...

I've corrected the offending word...

Mea culpa...
Paolo


« Last Edit: November 01, 2007, 03:33:08 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!