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

Home -> Community -> Usenet -> comp.databases.theory -> Re: View updating in practice?

Re: View updating in practice?

From: Mikito Harakiri <mikharakiri_at_yahoo.com>
Date: 13 Nov 2002 11:22:16 -0800
Message-ID: <bdf69bdf.0211131122.6caa9336@posting.google.com>


"Jens Lechtenbörger <lechtej_at_uni-muenster.de> wrote in message news:<m28yzxhlih.fsf_at_pcwi1068.uni-muenster.de>...
> > Relation A:
> >
> > ID VOICE FAX
> > -- ----------- --------------
> > 1 4150000000 4081111111
> > 2 80012345672 6501234567
> >
> > select id, 'VOICE' phonetype, voice number
> > from A
> > union
> > select id, 'FAX' phonetype, fax number from A
> >
> > What is the method to invert it?
>
> It should be a join of (a) the projection of the view on id and
> voice_number and (b) the projection of the view on id and
> fax_number, i.e., something like this:
>
> select v1.id, v1.voice_number, v2.fax_number
> from
> (select id, voice_number from view) as v1,
> (select id, fax_number from view) as v2
> where v1.id=v2.id

Correct. Note that cartesian product and union are dual operations

http://groups.google.com/groups?q=dual+group:comp.databases.theory+author:mikito&hl=en&lr=&ie=UTF-8&as_drrb=b&as_mind=12&as_minm=5&as_miny=1981&as_maxd=28&as_maxm=12&as_maxy=2002&selm=bdf69bdf.0210050531.4e420d83%40posting.google.com&rnum=1

(The summary table at the end has a typo -- union is dual to CP.it is corrected in the followup message). Your result, where inverse view has CP operation in it, is not surprising from that perspective.

Now the idea is to treat the original view

select id, 'VOICE' phonetype, voice number from A union
select id, 'FAX' phonetype, fax number from A

as a system of equations with relational operators, and then solve it like we do it in classic algebra with step-by-step elimination process. Received on Wed Nov 13 2002 - 13:22:16 CST

Original text of this message

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