Saturday, 7 June 2014

How to drop a constraint on DB2

How to drop a constraint on DB2

WARNING: take care of constraint created with quotes

Schema Name: group1
Table Name: EMPLOYEE
Constraint Name = KEY1

db2 alter table group1.employee drop constraint group1.key1

If the constraint was created between quotes, so you need to have attention when you will manipulate this constraint, example, when you will drop this constraint:

See the example below:


db2 set schema group1
db2 'alter table group1.employee drop constraint "key1"'

No comments:

Post a Comment