#1  
Old 11th February 2012, 01:39 PM
Scott Slater
 
Posts: n/a
Default Referential Integrity question

First, I'm using Delphi 2007 with Nexus 3.05.01.

My app uses 36 different tables all with ref int. I was adding some new ref
int rules to a detail table that I know will cause 2 of the records in the
table to violate the target required constraint of the rule. The rule was
added successfully but the records remained in the table. I can even edit
the records without any ref int complaints. If I try to add a new record
using the same values I do get a ref int error about a missing master record
so I know the rule is active.

Is a target required constraint only enforced on an insert or if the fields
involved in the constraint are modified? I was expecting these two records
to be deleted from the table once the ref int rule was created because they
violated the target required constraint. Is this normal? Is there a way to
force Nexus to reapply constraints to weed out invalid records that don't
meet the new constraints? I tried Pack and that did not do anything.

--
Scott Slater

  #2  
Old 14th February 2012, 07:09 AM
Scott Slater
 
Posts: n/a
Default Re: Referential Integrity question

Anyone with ideas?
--
Scott Slater

"Scott Slater" <sslater at aegroup dot com> wrote in message
news:4f35c6ca$1@DSVR011613....
> First, I'm using Delphi 2007 with Nexus 3.05.01.
>
> My app uses 36 different tables all with ref int. I was adding some new
> ref int rules to a detail table that I know will cause 2 of the records in
> the table to violate the target required constraint of the rule. The rule
> was added successfully but the records remained in the table. I can even
> edit the records without any ref int complaints. If I try to add a new
> record using the same values I do get a ref int error about a missing
> master record so I know the rule is active.
>
> Is a target required constraint only enforced on an insert or if the
> fields involved in the constraint are modified? I was expecting these two
> records to be deleted from the table once the ref int rule was created
> because they violated the target required constraint. Is this normal? Is
> there a way to force Nexus to reapply constraints to weed out invalid
> records that don't meet the new constraints? I tried Pack and that did
> not do anything.
>
> --
> Scott Slater
>


  #3  
Old 14th February 2012, 12:41 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Referential Integrity question

> Is a target required constraint only enforced on an insert or if the
> fields involved in the constraint are modified? I was expecting


Yes.

> these two records to be deleted from the table once the ref int rule
> was created because they violated the target required constraint. Is
> this normal? Is there a way to force Nexus to reapply constraints to
> weed out invalid records that don't meet the new constraints? I
> tried Pack and that did not do anything.


I suspect the majority of users would be appalled if the database
engine deleted records without further ado. I'm afraid you'll need to
check manually wether existing data fulfils the ref int constraints.
The engine can't really know what you'd want do to with records that
doesn't.

--
Eivind Bakkestuen [NDD]
  #4  
Old 15th February 2012, 07:41 AM
Q Correll
 
Posts: n/a
Default Re: Referential Integrity question

Eivind,

| I suspect the majority of users would be appalled if the database
| engine deleted records without further ado. I'm afraid you'll need to
| check manually wether existing data fulfils the ref int constraints.
| The engine can't really know what you'd want do to with records that
| doesn't.

I'm glad you typed that. <g>

Way back, in the dim distant past, when I was using Paradox, with
Referential Integrity related tables, I routinely checked returned
records for that "integrity" and sent them off to a special table for
review if they did not pass the RI test.


--

Q

02/14/2012 11:37:11

XanaNews Version 1.19.1.278 [Q'sBrokenToolBar]


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Referential Integrity pierrotsc nexusdb.public.support 2 25th January 2012 12:18 PM
Referential integrity question.. Roberto Nicchi nexusdb.public.support 7 2nd December 2008 08:24 PM
Referential Integrity Mark Mitton nexusdb.public.support 1 3rd March 2006 01:09 PM
Re: V2 and referential integrity Robert Meek nexusdb.public.support 1 13th March 2005 09:14 AM
Referential integrity! Atmapuri nexusdb.public.support 6 30th September 2003 08:45 AM


All times are GMT +11. The time now is 05:45 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.