Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Reference table and primary key
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 | 2Received on Mon Sep 24 2001 - 16:48:21 CDT