zoukankan      html  css  js  c++  java
  • Oracle查看表之间的约束

    ----查看表约束 

    表格: 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%';

  • 相关阅读:
    dfs-入门模板
    dp-状压dp
    c++ sizeof详解
    各种排序算法
    简介
    第178场周赛总结
    单调队列
    2019.10.24刷题统计
    2019.10.23刷题统计
    2019.10.22刷题统计
  • 原文地址:https://www.cnblogs.com/hesi/p/9670386.html
Copyright © 2011-2022 走看看