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: 65153
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: Get session to ignore commits and rollbacks
Next Topic: Row prefetch attribute and Stored procedures refcursor
Goto Forum:

Current Time: Tue Aug 22 21:34:43 CDT 2017

Total time taken to generate the page: 0.05522 seconds