Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Check constraints, the impossible dream?

Re: Check constraints, the impossible dream?

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 22 Mar 2002 11:44:49 -0000
Message-ID: <3c9b1941$0$234$ed9e5944@reading.news.pipex.net>


"John Ashton" <jashton_at_thunkbox.com> wrote in message news:hhtm8.2016$IA.134570_at_news-binary.blueyonder.co.uk...
> But what about the other problem with more than one check constraint per
> table?

You are right. Check constraints do not provide of themselves useful error messages to the end user, so if you wish to provide a more meaningful error you have to intercept the error and interpret it using code. At least if there is another way I have yet to come across it.

I think the point about doing the same check twice is *slightly* awry. Yes you are doing the same check (field > 0) or whatever, but you are doing it for two different reasons. In the app you are doing it to ensure that the end-user (off that app) is educated. In the database you don't actually care about the user - you are doing it to protect the data. It therefore doesn't seem unreasonable to me that you do the work twice as you are actually doing two different things. In addition as I think your posts recognise oftentimes data gets into datastores by means other than the application - data loads, overnight batch loads etc. these means oftentimes(always) don't need the interpreting layer of code.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
Received on Fri Mar 22 2002 - 05:44:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US