oracle查询表的注释,及列的注释
oracle查询表的注释,及列的注释
[sql] select t3.table_name,t3.comments,t2.comments,t1.COLUMN_NAME ,t1.DATA_TYPE||'('||decode(t1.DATA_TYPE, '', t1.DATA_PRECISION+t1.DATA_SCALE, t1.data_length)||')' from user_tab_cols t1, user_col_comments t2, user_tab_comments t3 where t1.TABLE_NAME=t2.table_name(+) and t1.COLUMN_NAME=t2.column_name(+) and t1.TABLE_NAME=t3.table_name(+) and lower(t1.TABLE_NAME)='user';
select distinct data_length from dba_tab_cols where data_type ='NUMBER'
结果:
22
1
2
3
0