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

Home -> Community -> Usenet -> c.d.o.server -> Reference table and primary key

Reference table and primary key

From: Phil Goden <noble_at_audiophile.com>
Date: Mon, 24 Sep 2001 22:48:21 +0100
Message-ID: <nPNr7.3966$2K4.810144@news6-win.server.ntlworld.com>


Can anyone help

I am attempting to create the three tables listed below, however, the lu_group_process fails because rangeNumber is not a primary key nor has it a unique index. How do I get around this without building a compound key in lu_group and without having to include a compound key from lu_group on lu_group_process table.

create table lu_group(
 id number(8) not null
,startRange varchar2(5) not null
,endRange varchar2(5) not null
,rangeNumber number(4) not null
,constraint group_pk primary key (id) using index tablespace
&&my_index_tablespace
);

create table lu_Process(
 id number(8) not null
,description varchar2(30) not null
,constraint process_pk primary key (id) using index tablespace
&&my_index_tablespace
);

create table lu_group_process (
 id number(8) not null
,rangeNumber number(4) not null
,processID number(8) not null
,constraint groupProcess_group_fk foreign key (rangeNumber) references
lu_group(rangeNumber)
,constraint groupProcess_process_fk foreign key (processID) references
lu_process(id)
);

in the tables, I am hoping to have entries such as

lu_group:

1 | 'A' | 'C' | 1
2 | 'D' | 'E' | 1
3 | 'F' | 'p' | 1
4 | 'Q' | 'Z' | 1
5 | 'A' | 'Z' | 2

lu_process:

1 | 'Process1'
2 | 'Process2'
3 | 'Process3'

lu_group_process:

1 | 1 | 1
2 | 1 | 2
3 | 2 | 2
Received on Mon Sep 24 2001 - 16:48:21 CDT

Original text of this message

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