Re: Jan's well-defined view updates definition
Date: Tue, 16 Sep 2003 14:57:16 -0700
Message-ID: <APL9b.27$cW6.108_at_news.oracle.com>
"Jan Hidders" <jan.hidders_at_pandora.be> wrote in message
news:s2K9b.23287$Jm4.1458233_at_phobos.telenet-ops.be...
> That's one way of looking at it, and certainly a valid and interesting way
> to do so, but it is not the only valid point of view and certainly not how
> I see it. The intention of my definition was to get the most liberal
notion
> of "updatable" that still makes sense. That doesn't mean that more
> restricted notions like yours don't make sense, but I would say that you
> would have to somehow justify your extra restriction. Since we are not
just
> doing mathematics here but computer science it is not enough to say that
> the mathematics becomes more elegant.
> > If some word have multiple meanings we have ambiguity, but
> > typical solution in computer science is not to guess the best
> > solution, right?
>
> Could you define 'typical'? :-) I see least fixpoints all over the place.
> Think of the semantics of formal grammars, lambda calculus, Prolog, SQL
> with recursion, the definition of natural numbers, et cetera.
I was thinking rather about computer refusing to amend user's typos:-)
Could we try redefining "well-defined" in my terms one more time? If we can add one or more view equations to get an invertible transformation, then, we call view "well-defined". In your example,
Q1 = (SELECT name
FROM D
WHERE dept = "sales"
)
we add
Q2 = (SELECT name
FROM D
WHERE dept <> "sales"
)
Now, if you have view update
insert into V1 values ('Smith')
we express it as a "delta" relation like this:
deltaV1 = (select 'Smith' as name from DEE)
Our main assumption is that view V2 doesn't change:
deltaV2 = (select null as name, null as dept from DUM)
and, therefore,
deltaD = Q^(-1) * <deltaV1, deltaV2> =
= (
select name, 'sales' as dept from deltaV1
union
select name, dept from deltaV2
) * <deltaV1, deltaV2>
Substituting view deltas into transformation formulas we have
deltaD =
(select name, 'sales' as dept from (select 'Smith' as name from DEE)
union
select name, dept from (select null as name, null as dept from DUM)
)
Or, after obvious equivalent query transformation:
deltaD = select 'Smith' as name, 'sales' as dept from DEE
which is your desired result. Received on Tue Sep 16 2003 - 23:57:16 CEST