您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle 获取表的包含约束的结构信息

2025/10/27 10:01:44发布27次查看
环境 oracle 9 release 2用户sys测试表名attribute_transformations$使用到的数据字典中的表和视图
环境 oracle 9 release 2
用户sys
测试表名attribute_transformations$
使用到的数据字典中的表和视图
user_tab_columns:用户表基本机构信息
user_constraints:用户约束基本信息
user_cons_columns:用户约束与字段对应信息
select a.column_name,a.data_type,a.data_length,b.constraint_type,b.r_table_name,b.r_column_name
 from
(select column_name,data_type,data_length from user_tab_columns where user_tab_columns.table_name='attribute_transformations$') a,
(  select a.column_name,a.constraint_type ,b.table_name r_table_name ,b.column_name r_column_name
    from
    (   select a.constraint_name,a.constraint_type,a.r_constraint_name,b.table_name,b.column_name
        from user_constraints a, user_cons_columns b
        where   a.constraint_name=b.constraint_name and a.table_name='attribute_transformations$') a
    left join user_cons_columns b on a.r_constraint_name=b.constraint_name
) b
where a.column_name=b.column_name(+)
运行结果

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product