--查询表TP_MENU有哪些约束
select * from user_constraints u where u.constraint_name like '%TB_ROLE%';
--失效约束
alter table TP_MENU disable constraint FK_TP_MENU_REFERENCE_TP_MENU cascade;
alter table TB_ROLE_REF_MENU disable constraint FK_TB_ROLE__REFERENCE_TP_MENU cascade;
--删除数据
delete from tp_menu t where t.status = 0;
--生效约束
alter table TP_MENU enable constraint FK_TP_MENU_REFERENCE_TP_MENU;
alter table TB_ROLE_REF_MENU enable constraint FK_TB_ROLE__REFERENCE_TP_MENU;
--查看数据
select * from TP_MENU;
本文介绍了一种针对特定数据库表(如TP_MENU和TB_ROLE)的约束管理流程,包括查询约束、禁用约束、删除数据、重新启用约束等操作,并提供了具体的SQL语句示例。
1102

被折叠的 条评论
为什么被折叠?



