Quantcast
Channel: Remote Oracle Database Support
Viewing all articles
Browse latest Browse all 155

ORA-02266: unique/primary keys in table referenced by enabled foreign keys

$
0
0

ORA- Error :


SQL> truncate table mis_report_new;
truncate table mis_report_new
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys


Cause :

Dependency of primary/unique column of the table being truncated is referenced by a table causing error ORA-02266 and denying the structural changes to the table while using truncate as DDL statement.

Solution :

Considering the dependency of primary/unique column is taken care by removal of the referenced key values, the error ORA-02266 can be avoid using delete DML statement.


SQL> delete from mis_report_new;

1872 rows deleted.

SQL> commit;

Commit complete.



Viewing all articles
Browse latest Browse all 155

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>