Oracle通過欄位類型查詢欄位

來源:互聯網
上載者:User

Oracle通過欄位類型查詢欄位

有的時候我們需要在Oracle中通過欄位名、欄位類型、欄位長度、欄位注釋、表名來查詢具體的欄位資訊。比如:昨天同事問我,咱們資料庫裡面有用過blob類型的嗎?我一時也想不起來具體哪個欄位或那張表用了blob類型。於是就用如下語句查詢庫裡面所有欄位類型為blob。具體sql如下:

SELECT b.column_name column_name --欄位名
      ,b.data_type data_type    --欄位類型
      ,b.data_length            --欄位長度
      ,a.comments comments      --欄位注釋
      ,A.table_name table_name    --表名
FROM user_col_comments a
    ,all_tab_columns b
WHERE a.table_name = b.table_name and
    b.data_type = 'BLOB'
    group by b.column_name,b.data_type,b.DATA_LENGTH,a.comments,
    a.table_name;

查詢到的如下:

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.