Skip to content
Advertisement

How to remove check constraint?

I am having difficult to remove CHECK using Alter in sql. Can anyone help me please?

Advertisement

Answer

Oracle does have an alter table ... drop constraint syntax for this.

But since you created an anonymous constraint, so this is tricky – because you don’t know the name of the constraint.

One option is to use dynamic SQL to retrieve the constraint name, and drop it with an execute immediate command:

Demo on DB Fiddle:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement