| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: foundations of relational theory?
Lauri Pietarinen wrote:
> Jonathan Leffler wrote: >
Thanks, Jonathon. Firstly, the constraint syntax is reminiscent of old scripting languages; field = '' [then] field != '' [then]... I am assuming this is a common syntax. Procedural syntax is simply more elegant, but that's not a functional comment, it's an aesthetic one.
More to the point, the more complex the constraint (and I was giving only the simplest above,) won't it become, simply, unreadable? And what if you wanted the constraint to be be dependent on "foreign" data (I think you call it), ie: if(sum(values_from_another_table if present for this record key) < 0) [ok] elseif (something else..) etc. I see these as valid "constraints" in that, while maybe infringing on business rule territory, they should still be enforced at the lower level as part of the db set.
Procedurally, this would be easy; in Pick we would encode the rules (in PickBasic, like it or not,) in a file-write-time trigger subroutine. Whether or not it's an automatic trigger; if it's automatic, it could not be violated by errant application programmers or other non-data-entry methods of update.
> The problem with constraints like these is that, yes, you safeguard your > db from corrupt data, but getting the information back into the > application is not that easy: you have to parse the error message, get > the name of the constraint and translate it into a meaningfull error > message for the user. I don't know if anybody does this, so, in effect > you end up coding the same checks twice: in the app and in the db. > > This is where we run into the frustrating "mismatch" between app > language and db environment.
That is the main problem of centralizing the constraints; you would have no user-feedback until submit of the entire dataset, which is both frustrating and counter-productive, and, in fact probably unacceptable to users (or, I should say, used to be; web-based data entry is inuring us to nasty messages at submit time instead of at data-entry time.) So, as you say, you check once at dataentry time and again (perhaps more robustly,) at dbms time.
Chandru Murthi
> regards,
> Lauri
Received on Tue Oct 28 2003 - 15:07:57 CST
![]() |
![]() |