Home » SQL & PL/SQL » SQL & PL/SQL » Problem Truncating a Table (ORACLE 10g Windows)
Problem Truncating a Table [message #309177] Wed, 26 March 2008 13:33 Go to next message
Messages: 5
Registered: January 2008
Location: Duluth
Junior Member
Not sure why I get the oracle error "02266: unique primary keys in table referenced by by enabled foreign key"

First, I truncate all of the records in the child table, so
its empty, but when I try to truncate the parent table I get this error. Do I have to disable constraints in order for this to work?
Re: Problem Truncating a Table [message #309180 is a reply to message #309177] Wed, 26 March 2008 13:44 Go to previous message
Michel Cadot
Messages: 63911
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do I have to disable constraints in order for this to work?

Yes it does not matter if there are data or not. There must be no enable foreign key constraint in order to be able to truncate a table.

Previous Topic: how to reset the sequence value
Next Topic: Analytical Function - Window Clause RANGE
Goto Forum:

Current Time: Sat Oct 22 11:29:54 CDT 2016

Total time taken to generate the page: 0.10632 seconds