2012-04-20 38 views
0

我工作的H2數據庫中添加多限制,我遇到這樣的問題 - 下降一個約束是好的,我可以用這個語句如何下降,由1個SQL語句H2數據庫

alter table customer drop constraint if exists fk_customer_order ; 

對於添加一個約束也沒關係,我可以使用這個語句。

alter table customer add constraint fk_customer_order foreign key (order_id) references order (id) on delete cascade on update cascade; 

但問題是,在客戶表我有更多的外鍵,我想在一個查詢語句刪除它們。 像這樣

alter table customer drop constraint fk_customer_order 
drop constraint fk_customer_information 
drop constraint .... 

但這似乎不能在H2數據庫來完成,任何人都可以告訴我可以還是不添加或1個SQL statment降多約束?任何答案都歡迎,我很欣賞。

回答

0

我認爲這是不能做到的。你爲什麼不使用多個語句?