|
(Yuli Vasiliev) According to Oracle Documentation, you cannot specify referential integrity constraints on REFs that are in nested tables. This means that Oracle Database doesn’t have its own mechanism to solve this problem. However, you may try to develop your own method that is to fill in the gap. For example, you could create a BEFORE DELETE trigger on the table whose rows may be referred to from a REF column that is in a nested table. This trigger fires whenever the user tries to delete a row from the table. If the user is trying to delete a row that is referred to, the trigger is supposed to prevent it. At first glance, it sounds good. However, you must understand that in this case you will have to look through all the nested tables that can potentially contain references to the deleted row. If you have thousands rows in your outer table, you probably won’t like this approach. However, you can easily simplify your task if you work with the storage table instead of a large number of nested tables. |