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

Home -> Community -> Usenet -> c.d.o.misc -> Re: foreign key references on view DUH...

Re: foreign key references on view DUH...

From: TurkBear <jgreco1_at_mn.rr.com>
Date: Thu, 28 Mar 2002 08:45:41 -0600
Message-ID: <g1b6au043hch0lps8j85dtqa4qpett51lk@4ax.com>

Thanks for the clarification, Connor. I forgot about that...( the constraints that is, not your humor's quality )

Connor McDonald <connor_mcdonald_at_yahoo.com> wrote:

>TurkBear wrote:
>>
>> As my preceding post will indicate, my appreciation for Connor's subtle humor is impaired early ( for me) in the AM...
>>
>> Connor McDonald <connor_mcdonald_at_yahoo.com> wrote:
>>
>> >Sybrand Bakker wrote:
>> >>
>> >> On Tue, 26 Mar 2002 14:20:21 +0100, zorg <czorman_at_wanadoo.fr> wrote:
>> >>
>> >> >this a simple of the problem
>> >> >i've two table which share the same key "numcom"
>> >> >
>> >> >
>> >> >
>> >> >CREATE individual(
>> >> > numcom NUMBER(4) primary key,
>> >> > name VARCHAR(30),
>> >> > );
>> >> >
>> >> >
>> >> >CREATE group(
>> >> > numcom NUMBER(4) primary key,
>> >> > responsable VARCHAR(30),
>> >> > );
>> >> >
>> >> >
>> >> >i've another table (like reservation) which has got a foreign key that
>> >> >should be the union of the field numcom
>> >> >
>> >> >1/ should i create a view like
>> >> >create view allkey
>> >> >select numcon from individual
>> >> >union
>> >> >select numcon from group(
>> >> >
>> >> >and
>> >> >add constraint like
>> >> > foreign key (the_other_table) references allkey(numcon)
>> >> >don't know if it work and if it's the best way to do it
>> >> >
>> >> >hope the problem is clear
>> >> >
>> >> >thank
>> >>
>> >> Foreign keys to views are NOT possible.
>> >> A more or less straightforward solution looks like
>> >> merge the two tables into one, adding an extra column, which will
>> >> contain a switch indicating which type of record you have.
>> >> Define views referring to the value of the switch for each subtype you
>> >> have in your table.
>> >>
>> >> Hth
>> >>
>> >> Sybrand Bakker, Senior Oracle DBA
>> >>
>> >> To reply remove -verwijderdit from my e-mail address
>> >
>> >I haven't checked them out, but rumour has it that you can add
>> >constraints to view in 9i (but I think they have to be DISABLED
>> >NOVALIDATE)
>> >
>> >hth
>> >connor
>>
>> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>> Check out our new Unlimited Server. No Download or Time Limits!
>> -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----
>
>
>No humour intended (and indeed my humour is typically neither subtle or
>good!)...the constraints do exist on views - mainly for query rewrite.
>
>hth
>connor

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!  Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Thu Mar 28 2002 - 08:45:41 CST

Original text of this message

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