Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete foreign key without name in Oracle

 
RabiDas Sharma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I forgot to give name of foreign key constraint.
i.e,
I added Foreign key constraint in the following way:

ALTER TABLE Result1
ADD foreign key (stud_id) references Student(stud_id);

How I can drop the above foreign key constraint...???


thanks
with regards
 
Heena Agarwal
Ranch Hand
Posts: 262
4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Query the user_constraints table to get the constraint_name.

Then run an alter table query that will drop that constraint.

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic