开发者

How to drop a unique constraint in Firebird

开发者 https://www.devze.com 2023-01-18 13:26 出处:网络
I have this table CREATE TABLE \"VACCINE\" ( \"CVX\"INTEGER, \"CPT\"CHAR(5), \"SHORTNAME\"VARCHAR(20), \"FULLNAME\"VARCHAR(256),

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开发者_JAVA百科 table vaccine drop constraint 'INTEG_400'

where INTEG_400 is the result of the select.


I think this will work :

alter table vaccine drop constraint INTEG_400

Try with IBExpert : it will show you the code

0

精彩评论

暂无评论...
验证码 换一张
取 消