脚本宝典收集整理的这篇文章主要介绍了oracle 查询表名以及表的列名,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
1.查询表名: select table_n
ame,tablespace_name,temporary
From user_tables [where table_name=表名]
其中:table_name:表名(v
Archar2(30));
tablespace_name:存储表名的表空间(
VARchar2(30));
temporary:
是否为临时表(varchar2(1))。
eg: select table_name,tablespace_name,temporary f
rom user_tables where table_name='
test_TEMP';
结果:
--------------------------------------------------------------------------------
table_name tablespace_name temporary
TEST_TEMP SDMP N
--------------------------------------------------------------------------------
注:表名
变量值必须大写。
2.查询表列名:
select column_name,data_ty
PE ,data_length,data_
PRecision,data_scale from user_tab_columns [where table_name=表名];
其中:column_name:列名(varchar2(30));
data_type:列的数据类型(varchar2(106));
data_length:列的长度(number);
eg:select column_name,data_type ,data_length,data_precision,data_scale from user_tab_columns where table_name='TEST_TEMP';
结果:
--------------------------------------------------------------------------------
column_name data_type data_length data_precision data_scale
ID NUMBER 22 0
NAME NVARCHAR2 20
SEX CHAR 1
GRADE NVARCHAR2 10
--------------------------------------------------------------------------------
注:表名变量值必须大写。
另外,也可以通过 all_tab_columns来获取相关表的数据。
eg:select * from all_tab_columns where table_name='TEST_TEMP';
脚本宝典总结
以上是脚本宝典为你收集整理的oracle 查询表名以及表的列名全部内容,希望文章能够帮你解决oracle 查询表名以及表的列名所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。