oracle怎么查询数据类型
时间:2022-05-13 16:19
在oracle中,可以利用“select ... From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');”语句查询数据库表的数据类型。 本教程操作环境:Windows10系统、Oracle 11g版、Dell G3电脑。 oracle查询数据类型语法如下: 示例如下: 扩展知识: 1、看字段名与数据类型 2、查看指定列的数据类型 3、查看全部列 4、查看某些列 5、可以通过user_constraints查看所有约束 6、查看主键约束: 推荐教程:《Oracle视频教程》 以上就是oracle怎么查询数据类型的详细内容,更多请关注gxlsystem.com其它相关文章!oracle怎么查询数据类型
select column_name,data_type,DATA_LENGTH From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');
select column_name,data_type,DATA_LENGTH From all_tab_columns
where table_name=upper('t_department') AND owner=upper('scott')
select * from cols WHERE TABLE_name=upper('表名'); (user_tab_columns缩写cols)
select DATA_TYPE from User_Tab_Columns t where t.column_name=upper('列名') and t.table_name =upper(trim('表名'));
select * from user_tab_columns where table_name = upper(‘表名’);
select column_name,data_type,data_length,DATA_PRECISION ,DATA_SCALE from all_tab_columns where table_name=upper('表名');
select * from user_constraints where table_name = upper('表名');
select * from user_constraints where constraint_type='P'
and TABLE_name=upper('表名');