| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: more closed-world chatter
paul c wrote:
> Bob Badour wrote:
>
> Thanks, I feel better now. Still, I'd like to know I could paraphrase
> that query a little more formally, say using D&D <AND>. But the
> stipulation "It is required that if <A,T1> is in Hr1 and <A,T2> is in
> Hr2, then T1 = T2" stymies me, eg., if pricedomain={1,2} and
> anotherdomain={3}, it seems that <AND> isn't defined.
Yes, so your query would fail on a type mismatch in A. If it is desirable for such a query to succeed (with an empty result), /and/ to be equivalent to an <AND>, I believe the (declared) type of the Price attribute in the result would have to be a common supertype of the Price types in the operands. And that may be slightly counter-intuitive if you formulate the query as a RESTRICT.
But why are you unhappy about treating such a query as an error? It can be caught at compile-time, and isn't all that different from the error I'd expect if I declare a variable of type Price and try to assign it the value "red".
> (I realize I could get the "false" answer suggested if only one side of > the <AND> used the "Items" attribute
The Price attribute, you mean? Then the <AND> would be a product, and the result empty ("false"?) only by virtue of the Items relation being empty. I don't see how this helps in any way.
-- JonReceived on Thu May 03 2007 - 09:30:10 CDT
![]() |
![]() |