Home » SQL & PL/SQL » SQL & PL/SQL » ORA-02266: unique/primary keys in table referenced by enabled foreign keys
ORA-02266: unique/primary keys in table referenced by enabled foreign keys [message #18734] Tue, 12 February 2002 19:57 Go to next message
krahuman
Messages: 18
Registered: January 2002
Junior Member
hai ora 8i ex's !
this is my problem !
in my database there are more than 150 tables in which al the tables having primary key and
some of having foreign key relations
i am having header-details tables as well.

what i wat to do is,
to transfer daily transactions ( header,details table data) to the head office.

i am trying to use exp/imp facility.
i am having no problem with exp.

if i need to truncate the tables before imp.
should i truncate all the tables.

lets say if i want to imp one table should i truncate all the tables linked to this

when i am trying to truncate one master table the following message is comming
what should i do ?

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

is there any other method to transfer data from one db to another db?

krahuman.
thanks
Re: ORA-02266: unique/primary keys in table referenced by enabled foreign keys [message #18739 is a reply to message #18734] Tue, 12 February 2002 21:55 Go to previous message
Satish Shrikhande
Messages: 167
Registered: October 2001
Senior Member
The error is because you have detail table which is refering the master table data ,so you can't delete the master table data which has detail record ,and you have only one alterative truncate the detail .
Previous Topic: coping a one schema to another schema
Next Topic: Difficulty Framing a Query
Goto Forum:
  


Current Time: Fri Apr 26 02:22:05 CDT 2024