Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> composed foreign key question
Hi NG,
same data different problem.
Plattform: Windows 2003 Server Oracle 10.1.0.3
daily_high number, daily_high_type char(1), daily_low number, daily_low_type char(1), lifetime_high number, lifetime_high_type char(1),
official_vol_prev number, open_int_prev number, open_int_change_prev number,
child-table:
create table option_prices (
contract date,
lookupdate date,
call_settle number, call_vola number, call_delta number,
put_settle number, put_vola number, put_delta number
That's the situation so far. Now I want to create a foreign key to keep referential integrity. The problem is I can't create a foreign key on the combination of to columns in the child- _and_ the parent-table. I thought of creating a foreign keys for every one of the two columns, but this would allow data to be inserted that cannot be referenced to the parent-table. e.g. combination of two dates from which each is in the parent-table but not in the particular composition. So for now I'm thinking of dropping the old primary key an constructing a generic primary key. The question is: Are there other possibilities, as I don't think it is good design, to generate an artificial primary key when I have an natural one.
Any help appriciated,
Moritz Received on Mon Sep 19 2005 - 08:56:18 CDT