Creating a foreign key on a view
Hi to all,
is it possible to create a foreign key to a view?
Let's say I created a view v_emp in scott like (create view v_emp as select * from emp). Then I go to "system" and I have a table named "test" which contains a column "empno". Thus I like to define a constraint which goes like
alter table test add constraint fk_empno foreign key (empno) references scott.v_emp (empno);
and results in an ORA-02444 "Cannot resolve referenced object in referential constraints"
This seems to tell me that I can only reference tables. Is this really true? I just can't believe this!
regards
Stefan