0

私はH2データベースに取り組んでおり、この問題を満たしています.1つの制約を削除することは問題ありません。このステートメントを使用できます

alter table customer drop constraint if exists fk_customer_order ;

制約を 1 つ追加しても問題ないため、このステートメントを使用できます。

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

しかし、問題は、顧客テーブルに複数の外部キーがあり、1 つのクエリ ステートメントでそれらを削除することです。このようなもの

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

しかし、これはh2データベースでは実行できないようです。1つのSQLステートメントで複数の制約を追加または削除できるかどうかを誰かが教えてくれますか? どんな答えでも大歓迎です。

4

1 に答える 1

0

仕方ないと思います。複数のステートメントを使用しないのはなぜですか?

于 2012-04-24T19:50:55.807 に答える