一、获取表字段:

    select *  from user_tab_columns where Table_Name='用户表' 

 

user_tab_columns 为当前用户的columns,除此之外还有all_tab_columnsdba_tab_columns,这两个多了owner

 select *  from all_tab_columns where Table_Name='用户表'  and owner = 'admin'

 

二、获取表注释:

select * from user_tab_comments where Table_Name='用户表'

 

同理,还有all_tab_commentsdba_tab_comments ,也多了owner

三、获取字段注释:

select * from user_col_comments where Table_Name='用户表'

 

同理。。。

四、获取表所有字段信息及注释:

SELECT b.column_name columnName --字段名
,b.data_type dataType --字段类型
,b.data_length dataLength --字段长度
,b.data_precision dataPrecision --字段长度
,b.data_scale dataScale --字段长度
,b.NULLABLE nullable --可为空
,a.comments comments --字段注释
FROM all_col_comments a --注释表
,all_tab_columns b --列表
WHERE a.table_name = b.table_name and a.OWNER = b.OWNER and a.Column_name = b.Column_name and
a.table_name = '用户表' and a.OWNER='ADMIN'

相关文章:

  • 2021-07-11
  • 2021-11-24
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案