This content has been marked as final. Show 2 replies
There is no problem defining a primary key on a materialized view and then referencing it with a foreign key. This works for me:
I'm sure there is a more elegant solution than using a virtual column, that just seemed the quickest way of getting around concatenating two columns into one
create database link l1 connect to scott identified by tiger using 'orcl'; create materialized view mv1 as select deptno||dname as a from dept@l1; alter table mv1 add constraint mv1pk primary key (a); alter table dept add (fkcol as (deptno||dname)); alter table dept add constraint deptfk foreign key (fkcol) references mv1;
Ok, It was just that SQL Developer does not allow doing this with the graphical interface, at least in my outdated version.
Thank you very much.