Quote:
Originally posted by gurey
Hi Lloyd,
I think that the problem is the tree table have the same primary key.
So, for generate foreign key in another tables, create unique index without primary key.
I think that review the normalized table.
Happy year 2004.
Gustavo.
|
Hi Adityanlal / Gustavo,
Happy new year to you too. Thanks for your feedback.
I wanted to create these indexes in different dbspaces thats the reason i gave a name to it. I don't want informix to give a name for the indexes, later on it will be difficult for me to keep track of them, especially when i want to drop them.
create unique index b_idx on b(id) using btree in mydbspace
The first statement will create a unique index. This is a foreign key referring to table 'A', this will also be unique within the table
Alter table b add constraint (primary key (id) constraint b_pk)
This will create a primary key constraint, i have named the constraint.
Now for the foreign key constraint referring to table A
create index b_idx2 on b(id) using btreee in mydbspace
-- foreing key constraint
alter table b add constraint (foreign key(id) references a
constraint b_fk2)
Since informix allows only to indexes i will have to delete teh foreign key constraint.
Best Regards,
lloyd