ORACLE查询表注释
//字段注释
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‘
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。