Skip to Main Content
  • Questions
  • How to delete duplicated check constraints ?

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: September 29, 2002 - 12:48 pm UTC

Last updated: September 04, 2008 - 1:36 pm UTC

Version: 8.1.7

Viewed 1000+ times

You Asked

Dear Tom,

I found there are a lot of duplication checking constraitns in our database.

How can I delete all of duplicated checking constraints ?

Thanks !

and Tom said...

alter table tname drop constraint constraint_name;

do that for each of the duplicated constraints.


You probably got these from doing repeated IMPORTS of dmp files and the you have "un-named" (named with system generated names) constraints.

You can avoid that by NAMING all constraints. That way, IMP will not "recreate them" each time.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

How to find out the duplicated values in a column

Mike, September 04, 2008 - 10:58 am UTC

I'd like to print a list of the duplicated values in a column or more. Thanks.
Tom Kyte
September 04, 2008 - 1:36 pm UTC

select column, count(*) from t group by column having count(*) > 1;