zoukankan      html  css  js  c++  java
  • oracle导出数据字典

    SELECT
       t1.TABLE_NAME        AS "表名称",
           t2.comments        AS "表中文注释",
           t1.Column_Name                                AS "字段名称",
           t2.Comments                                   AS "字段中文注释",
           t1.DATA_TYPE                                  AS "字段数据类型",
           t1.DATA_LENGTH                                AS "字段长度",
           LONG_TO_CHAR(t1.TABLE_NAME,T1.COLUMN_NAME)        AS "默认值",
           case when  ta.CONSTRAINT_NAME is null then '' else '1' end   AS "主键" ,
           case when  tr.CONSTRAINT_NAME is null then '' else '1' end   AS "外键"
      FROM cols t1
      LEFT JOIN user_col_comments t2
             ON t1.Table_name = t2.Table_name
            AND t1.Column_Name = t2.Column_Name
      LEFT JOIN user_tab_comments t3
             ON t1.Table_name = t3.Table_name
      LEFT JOIN user_objects t4
             ON t1.table_name = t4.OBJECT_NAME
      left join(select cu.* from user_cons_columns cu, user_constraints au where
    cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.owner ='XXX') ta
    on ta.TABLE_NAME=t1.TABLE_NAME and ta.COLUMN_NAME=t1.Column_Name
       left join(select cu.* from user_cons_columns cu, user_constraints au where
    cu.constraint_name = au.constraint_name and au.constraint_type = 'R' and au.owner ='XXX') tr
    on tr.TABLE_NAME=t1.TABLE_NAME and tr.COLUMN_NAME=t1.Column_Name
       WHERE t4.Object_Type = 'TABLE'
               AND t4.Temporary = 'N'
      ORDER BY t1.Table_Name, t1.Column_ID;
  • 相关阅读:
    强化学习_PolicyGradient(策略梯度)_代码解析
    leetcode_1053. Previous Permutation With One Swap
    leetcode_1052. Grumpy Bookstore Owner
    Tensorflow_入门学习_2_一个神经网络栗子
    通过批处理快速设置IP
    汇编、编译、反汇编、反编译的简单概念介绍
    Logistic回归
    基于概率论的分类方法:朴素贝叶斯
    决策树 预测隐形眼镜类型
    k-近邻算法2(kNN)手写识别系统
  • 原文地址:https://www.cnblogs.com/hcy-zyy/p/14782693.html
Copyright © 2011-2022 走看看