數據庫的外鍵約束


執行以下sql生成的語句即可

1.刪除所有外鍵約束

select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where constraint_type='R'

2.禁用所有外鍵約束

select 'alter table '||table_name||' disable constraint '||constraint_name||';' from user_constraints where constraint_type='R'

3.啓用所有外鍵約束

select 'alter table '||table_name||' enable constraint '||constraint_name||';' from user_constraints where constraint_type='R'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章