Home » SQL & PL/SQL » SQL & PL/SQL » reference key
reference key [message #219232] Tue, 13 February 2007 11:21 Go to next message
durai
Messages: 38
Registered: December 2006
Member
SQL> drop table emp_dept;
drop table emp_dept
*
ERROR at line 1:
ORA-02449: unique/primary keys in table referenced by foreign keys

i created emp_dept earlier so i forgotten the foreign key
but how i can drop or delete forcefully
Re: reference key [message #219237 is a reply to message #219232] Tue, 13 February 2007 11:29 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>but how i can drop or delete forcefully
By dropping the FK first.
Re: reference key [message #219242 is a reply to message #219232] Tue, 13 February 2007 12:06 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Check out the Cascade keyword option in the drop table statement syntax.
Re: reference key [message #219279 is a reply to message #219232] Tue, 13 February 2007 15:21 Go to previous message
Admin@Lightsql.Com
Messages: 36
Registered: November 2006
Member

Try

drop table emp_dept cascade constraints;

Jay -
Programming with Oracle & Visual C++, Author of http://www.lightsql.com
Previous Topic: How to insert data in Procedure????
Next Topic: problem with cursor
Goto Forum:
  


Current Time: Fri Dec 09 07:48:16 CST 2016

Total time taken to generate the page: 0.10773 seconds