字段注释
select * from user_col_comments;
表注释
select * from user_tab_comments;
//
查询字段类型
select column_name,data_type,data_length from user_tab_columns where table_name='TableName' and column_name in ('AGE_ID','MONTH_ID')
Column_name值为大写
//
查询表的主键
select * from user_cons_columns where table_name='D_DAY'
//
select column_name from user_cons_columns where constraint_name in (select constraint_name from user_constraints where table_name = 'D_DAY' and constraint_type = 'P')
//查询某表字段的主键名称及类型
select column_name,data_type,data_length,DATA_PRECISION||','||DATA_SCALE from user_tab_columns v join (select column_name from user_cons_columns where constraint_name in (select constraint_name from user_constraints where table_name = 'D_DAY' and constraint_type = 'P')) t using (column_name) where table_name='D_DAY'