Forum OpenACS Q&A: Response to Oracle: dropping check constraints

Collapse
Posted by Daryl Biberdorf on

user_constraints is a view that allows you to view parts of the data dictionary that your schema owns. It's a no-no to modify the data dictionary with anything other than DDL (Data Definition Language) statements: CREATE, ALTER, DROP.

To do what you want, you'll need to drop the constraint and re-create it:

  SQL> create table dlb_test (id number not null primary key, xp char(1));

  Table created.

  SQL> alter table dlb_test add constraint dlb_const check (xp IN ('Y','N'));

  Table altered.

  SQL> alter table dlb_test drop constraint dlb_const;

  Table altered.

  SQL> alter table dlb_test add constraint dlb_const check (xp IN ('Y','N','M'));

  Table altered.

  SQL>