美文网首页
2019-01-08 oracle导出表结构脚本

2019-01-08 oracle导出表结构脚本

作者: emei18 | 来源:发表于2019-01-08 17:06 被阅读0次

    使用这个脚本可以导出表结构,不含数据

    SELECT B.TABLE_NAME     AS "Table",
           B.COLUMN_NAME    AS "Field",
           A.COMMENTS       AS "Desc",
           B.DATA_TYPE      AS "Type",
           B.DATA_LENGTH    AS "Len",
           B.nullable       AS "Nullable",
           B.COLUMN_ID      AS "Pos"
      FROM ALL_COL_COMMENTS A, ALL_TAB_COLUMNS B, ALL_TAB_COMMENTS C
    
    WHERE A.TABLE_NAME = UPPER('OTD_TRANSIT_DETAIL_INFO') --IN (SELECT U.TABLE_NAME FROM USER_ALL_TABLES U)
       AND A.OWNER = B.OWNER
       AND A.TABLE_NAME = B.TABLE_NAME
       AND A.COLUMN_NAME = B.COLUMN_NAME
       AND C.TABLE_NAME = A.TABLE_NAME
      -- AND C.OWNER = A.OWNER
       --AND A.OWNER = 'XXX'
    ORDER BY A.TABLE_NAME, B.COLUMN_ID;
    

    相关文章

      网友评论

          本文标题:2019-01-08 oracle导出表结构脚本

          本文链接:https://www.haomeiwen.com/subject/pgjbrqtx.html