Subject Re: [ib-support] error when add constraint
Author Martijn Tonies
Hi,


> When I try do perform this operation, I have a error. What's wrong?
>
> alter table DIARIO
> add constraint FK_DIARIO_DISCIPLINA_PROFESSOR foreign key
> (ID_DISCIPLINA,ID_PROFESSOR)
> references LECIONAR(ID_DISCIPLINA,ID_PARCEIRO);
>
>
> Operation Completed - There Were Errors
> ISC ERROR CODE:335544351
>
> ISC ERROR MESSAGE:
> unsuccessful metadata update
> could not find UNIQUE INDEX with specified columns

Do you have a unique or primary key constraints on columns
ID_DISCIPLINA & ID_PARCEIRO in table LECIONAR?

If not, how do you expect the database engine to be able to
uniquely identify the "parent" row?


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."