首页 > Oracle怎么查询表名、字段名以及字段的属性?

Oracle怎么查询表名、字段名以及字段的属性?

怎么使用Sql语句查询出一个命名空间中的所有表的名称和每个表的所有字段的名称以及每个字段的属性,即它是字符的还是数字的还是时间类型


正好前一段时间用到过,送给伸手党们。

主键查询
select table_name, constraint_name from all_constraints where OWNER='__USER__' and constraint_type='P'

索引查询
Select index_name, column_name, column_position, table_name from user_ind_columns order by table_name, index_name, column_position

数据表查询
select table_name from all_tables where owner='__USER__' order by table_name

表字段查询
select column_name, data_type, data_length, data_precision, data_scale, column_id, table_name from all_tab_columns where OWNER='__USER__' order by table_name, column_id asc

【热门文章】
【热门文章】