----查看表约束 

表格: user_constraints 

查询外键约束条件

select ' select count(*) from '||TABLE_NAME||';'
from user_constraints a
where
a.constraint_type = 'R'
and a.r_constraint_name='PK_JG0101';

----禁用相关外键约束
select 'ALTER TABLE '||TABLE_NAME||' DISABLE CONSTRAINT '||constraint_name||';'
From user_constraints A
where a.constraint_type = 'R'
and a.r_constraint_name='PK_XX0301'
and Status='ENABLED';

 

ALTER TABLE JS0101SQ DISABLE CONSTRAINT FK_JS0101SQ_XX0301;

----启用相关外键约束

ALTER TABLE JS0101SQ ENABLE CONSTRAINT FK_JS0101SQ_XX0301;

 

---查看数据库中的表名

表:user_tables 

select 'Drop table '|| TABLE_NAME||';'
from user_tables where TABLE_NAME like 'TEMP1%';

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
  • 2021-08-24
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案