Re: Declaring Unenforced Constraints

From: Dawn M. Wolthuis <dwolt_at_tincat-group.comREMOVE>
Date: Fri, 5 Nov 2004 13:52:01 -0600
Message-ID: <cmgll6$m30$1_at_news.netins.net>


"Laconic2" <laconic2_at_comcast.net> wrote in message news:yrudnS4h2tqFSBbcRVn-jg_at_comcast.com...
>
> "Paul" <paul_at_test.com> wrote in message
> news:418bd2af$0$524$ed2619ec_at_ptn-nntp-reader03.plus.net...
>
> > SQL Server has this as well, at least for foreign keys.
> >
> > It can be useful if you're loading in a massive amount of data from an
> > online system to a reporting system and you don't want to worry about
> > having to load the tables in a specific order or to have the whole thing
> > crash at the start due to a small broken key constraint.
>
> Thanks to you and to Tony for bringing me up to date on SQL Server and
> Oracle. How about DB2, anyone?
>
> > Once the data's in you can enable the constraints and make sure the data
> > is all valid. If it's not, you've got the data at hand to investigate
> > the problem easily.
>
> This is exactly what I was driving at. Thanks.

Sounds like a good idea to me. What this would also help with are the changes that occur in business logic where the database might not yet accomodate the change. We could then see the exceptions, recognize the data are actually good according to the current understanding of the business rules and change the database with good change control and quality assurance without either rushing or holding up the changes.

This can also help make constraints more like carrots than sticks. The application developer gets something out of having the strongest constraints needed without the potential trap of losing agility in the maintenance of the application.

One of the topics I brought up a while back was of "local constraints" where one application requires the constraint in its front-end and validation logic, but another does not. There are ways to encode such local constraints, as I understand it, but it is more likely that the validation logic is done only in the application and the database is never told of the application requiring the local constraint.

This is another case where you end up with constraint logic strewn throughout when it could have been in the database if the database were not seen as being so rigid and potentially holding up the software development effort.

Cheers! --dawn Received on Fri Nov 05 2004 - 20:52:01 CET

Original text of this message