关闭

ORACLE "desc table"对应的SQL语句

标签: tableoraclesqlnullfloatdate
13356人阅读 评论(0) 收藏 举报


desc test

等同于


 SELECT OWNER,
         TABLE_NAME,
         COLUMN_NAME,
         DATA_TYPE
         || DECODE (
               DATA_TYPE,
               'NUMBER', DECODE (
                               '('
                            || NVL (TO_CHAR (DATA_PRECISION), '*')
                            || ','
                            || NVL (TO_CHAR (DATA_SCALE), '*')
                            || ')',
                            '(*,*)', NULL,
                            '(*,0)', '(38)',
                               '('
                            || NVL (TO_CHAR (DATA_PRECISION), '*')
                            || ','
                            || NVL (TO_CHAR (DATA_SCALE), '*')
                            || ')'),
               'FLOAT', '(' || DATA_PRECISION || ')',
               'DATE', NULL,
               'TIMESTAMP(6)', NULL,
               '(' || DATA_LENGTH || ')')
            AS DATA_TYPE,
         DATA_LENGTH,
         NULLABLE
    FROM DBA_TAB_COLUMNS
   WHERE OWNER IN ('OWNER')
         AND TABLE_NAME = UPPER ('table_name')
 ORDER BY OWNER, TABLE_NAME, COLUMN_ID;



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:470491次
    • 积分:5561
    • 等级:
    • 排名:第4906名
    • 原创:127篇
    • 转载:39篇
    • 译文:0篇
    • 评论:24条
    文章分类
    最新评论