Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How to make a Foreign key in this scenario
Trying to make a many to many table relationship. One of our tables
contains files with versions (like 1, 2, 3, etc). We want to then tie
the access to the file based on a user's username (hence the many to
many table) and not a version in particular, but the file in general.
The caveat here is that we can not make a FK from Table 1 to Table 3
because we're not bringing the entire Primary key from Table 1 over.
You'll get a "ORA-02270: no matching unique or primary key for this
column-list" error.
Is there a way to enforce integrity in Table 3 making sure there is a matching value in Table 1 ? (without the version column of course).
Table 1
![]() |
![]() |