This content has been marked as final. Show 2 replies
We do not currently support the addition or removal of a foreign key constraint between a versioned and non-versioned table. Both of the tables need to be versioned. The only solution is to temporarily enableversion the non-versioned table, drop the constraint, and then execute disableversioning on the table.
as I ran into this today as well I feel like answering this question, as I suppose that the thread opener did the same mistake as I did, and maybe
some others do it as well :)
of course you need to open a DDL session on the parent table as well in order to drop foreign key constraints, just as you do when you add them.
so the correct order to make it work would be:
I felt kind of stupid that it took me 1 hour to figure this out ;)
EXECUTE DBMS_WM.BeginDDL('PARENT_TABLE'); EXECUTE DBMS_WM.BeginDDL('CHILD_TABLE'); ALTER TABLE CHILD_TABLE_LTS DROP CONSTRAINT FOREIGN_KEY_NAME / EXECUTE DBMS_WM.CommitDDL('CHILD_TABLE'); EXECUTE DBMS_WM.CommitDDL('PARENT_TABLE');