Subject | how to drop a unique constraint? |
---|---|
Author | gchiu2 |
Post date | 2010-10-04T20:56:33Z |
I have this table
CREATE TABLE "VACCINE"
(
"CVX" INTEGER,
"CPT" CHAR(5),
"SHORTNAME" VARCHAR(20),
"FULLNAME" VARCHAR(256),
"VTYPE" CHAR(1),
UNIQUE ("CVX")
);
but it turns out that CVX is not unique after all. How do I drop the unique constraint?
I can get the name of the constraint like this
select rdb$constraint_name from rdb$relation_constraints where rdb$relation_name = 'VACCINE'
but I get a syntax error after I do this
alter table vaccine drop constraint 'INTEG_400'
where INTEG_400 is the result of the select.
CREATE TABLE "VACCINE"
(
"CVX" INTEGER,
"CPT" CHAR(5),
"SHORTNAME" VARCHAR(20),
"FULLNAME" VARCHAR(256),
"VTYPE" CHAR(1),
UNIQUE ("CVX")
);
but it turns out that CVX is not unique after all. How do I drop the unique constraint?
I can get the name of the constraint like this
select rdb$constraint_name from rdb$relation_constraints where rdb$relation_name = 'VACCINE'
but I get a syntax error after I do this
alter table vaccine drop constraint 'INTEG_400'
where INTEG_400 is the result of the select.