Constraints
Posted in 1998
I have an interesting question. We are developing a systems using the Fourgen case tools, please do not comment on this for it was not our decision to use Fourgen tools, and would like to add database constrains for Referential Integrity. The problem arises with the tools when creating a screen with a parent to child to grandchild relationship. Fourgen's insert logic inserts the grandchild first, the parent second, and last the child. This violates the constraint on the primary key of the grandchild. To make a very long story a bit shorter, we are considering using the "DEFER CONSTRAINTS" statement to allow the insert to happen within a transaction. So my question boils down to: 1) Has any body tried this? 2) When the transaction is committed and the constraints are re-established, does the engine check the whole table for a constraint violation or just the information added or updated during the transaction which "DEFER CONSTARINTS"? 3) Is there a better way which does not require major changes to FOURGEN code? Thanks ---------------------------------------------------------------------------- --------- Ronald Twaddell (rtwaddel@ix.netcom.com <mailto:rtwaddel@ix.netcom.com> ) Management Information Consulting > "The most exciting phrase to hear in science, the one that heralds new > discoveries, is not 'Eureka' (I found it!) but 'That's funny...' " > Isaac Asimov