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: Foreign key problem

Re: Foreign key problem

From: Jay Dee <ais01479_at_aeneas.net>
Date: Thu, 15 Jun 2006 11:28:24 GMT
Message-ID: <svbkg.68231$P2.43250@tornado.ohiordc.rr.com>


x wrote:
> "Jay Dee" <ais01479_at_aeneas.net> wrote in message
> news:mn0kg.59063$mh.32302_at_tornado.ohiordc.rr.com...
>

>>I didn't pay  much attention to this until the thread got
>>surprisingly long.

>
>
>>frebe73_at_gmail.com wrote:
>>
>>>I am working on an application which need a data model that reflects
>>>the schema structure. My tables are ("*" indicates primary key column):
>>
>>The schema-before-model bit confuses me; are you really stuck in
>>this circumstance?.
>>
>>
>>>tableinfo(*table_name)
>>>columninfo(*table_name, *col_name)
>>>fk(*fk_name, pk_table, fk_table)
>>>fk_column(*fk_name, *fk_column, pk_column)
>>
>>All one really needs - using your notation - is
>>
>>  tables (*table_name)
>>  columns (*table_name, *col_name)
>>  foreign_keys (*fk_table_name, *fk_column,
>>                *pk_table_name, *pk_column)

>
>
>
> tables(t1).
> tables(t2).
>
> columns(t1,c1).
> columns(t1,c2).
> columns(t1,c3).
> columns(t1,c4).
>
> columns(t2,c5).
> columns(t2,c6).
> columns(t2,c7).
>
> foreign_keys(t1,c1,t2,c5).
> foreign_keys(t1,c2,t2,c6).
> foreign_keys(t1,c3,t2,c7).
>
>
> foreign_keys(t1,c2,t2,c6). "Saying something more than once doesn't make it more true."
> foreign_keys(t1,c3,t2,c7). "Saying something more than once doesn't make it more true."
> foreign_keys(t1,c4,t2,c5).
>
> t1(1,2,3,4).
> t2(1,2,3).
> t2(4,2,3).
>

Hmm. A _name_ /would/ be necessary to permit your example.. But what is the meaning of the overlapping constraints with different names? Received on Thu Jun 15 2006 - 06:28:24 CDT

Original text of this message

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