Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign key
I suggest
1. adding column valid_date_from to transaction table and
references by date and currency
or
2. addind id column to rate table as primary key
creating unique key on currency_code , date_from and date_to
and transactions table can references by this id
Guntur Kosasih wrote:
> I have exchange rate table (has column: currency_code, valid_date_from,
> valid_date_to, exchange_rate; Primary key is currency_code and
> valid_date_from) and transaction table (has column: trx_no, trx_date,
> currency_code, amount_in_trx).
>
> The problem is how can I create foreign key to exchange rate table, so I
> can know exchange_rate for every trx_date.
>
> Can anybody help me out here????
>
> Thanks in Advance.....
>
> Guntur Kosasih
> guntur_at_jaknet.com
Received on Thu Jan 07 1999 - 07:52:27 CST