Oracle用sql查询某张表的字段信息(字段类型长度等)

Posted 谢哥哥blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle用sql查询某张表的字段信息(字段类型长度等)相关的知识,希望对你有一定的参考价值。

查看某张表所有的字段信息

-- 查看某张表所有的字段信息
select
	t.table_name,  -- 表名
	t.column_name, -- 字段名
	t.data_type,   -- 字段类型
	t.data_length  -- 字段长度
from
	user_tab_columns t
where
	t.table_name='表名';

查看某张表的某个字段信息

-- 查看某张表的某个字段信息
select
	t.table_name,  -- 表名
	t.column_name, -- 字段名
	t.data_type,   -- 字段类型
	t.data_length  -- 字段长度
from
	user_tab_columns t
where
	t.table_name='表名' and t.column_name='字段名';

以上是关于Oracle用sql查询某张表的字段信息(字段类型长度等)的主要内容,如果未能解决你的问题,请参考以下文章