Subject | Re: [firebird-support] Foreign Key Part of Primary Key |
---|---|
Author | Nick Upson |
Post date | 2006-09-29T15:04:04Z |
for your definiton of USER_TZ_RESTRICTION to work, the primary key of
TZ_RESTRICTIONS must be TZ_ID, hence the error message
TZ_RESTRICTIONS must be TZ_ID, hence the error message
On 29/09/06, kiran.gutta@... <kiran.gutta@...> wrote:
> Hi,
>
>
>
> I have the following tables.
>
>
>
> TZ_RESTRICTIONS
>
> Columns: TZ_ID, ST_TIME, END_TIME
>
> Primary Key: TZ_ID, ST_TIME
>
>
>
> USER_TZ_RESTRICTION
>
> Columns: USER_ID, TZ_ID, TYPE
>
> Primary Key: USER_ID, TYPE
>
> Foreign key TZ_ID References TZ_RESTRICTIONS(TZ_ID)
>
>
>
>
>
> Functionally,
>
> For a given user and type, there can be multiple Time Zones. Each Time
> Zone contains multiple Start Times & End Times.
>
>
>
> When I create USER_TZ_RESTRICTION table, I get error "Could not find
> UNIQUE INDEX with specified columns."
>
>
>
> Please help me how to define the tables/references/constraints. I am new
> to RDBMS.