view_fk

简介:

create or replace view view_fk as
select
    a.table_name 外键表,
    c.column_name 外键列,
    b.table_name 主键表,
    d.column_name 主键列,
    decode(a.validated,'VALIDATED',0,1) 多选
from
    user_constraints a,
    user_constraints b,
    user_cons_columns c,
    user_cons_columns d
where
    a.r_constraint_name=b.constraint_name
    and a.constraint_type='R'
    and b.constraint_type='P'
    and a.r_owner=b.owner
    and a.constraint_name=c.constraint_name
    and b.constraint_name=d.constraint_name
    and a.owner=c.owner
    and a.table_name=c.table_name
    and b.owner=d.owner
    and b.table_name=d.table_name

 

 

分类:  Oracle

本文转自Lei Zhang的博客博客园博客,原文链接:http://www.cnblogs.com/threestone/archive/2010/07/01/1769191.html,如需转载请自行联系原作者
目录
相关文章
|
1月前
ALTER MATERIALIZED VIEW
Use the ALTER MATERIALIZED VIEW statement to modify an existing materialized view in one or more of the following ways: To change its storage characteristics To change its refresh method, mode, or time To alter its structure so that it is a different type of materialized view To enable or disabl
12 0
|
9月前
|
关系型数据库 MySQL 数据库
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
139 0
|
SQL Oracle 关系型数据库
SQL FOREIGN KEY Constraint on CREATE TABLE
SQL FOREIGN KEY Constraint on CREATE TABLE
63 1
|
存储 关系型数据库 MySQL
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
ERROR 1215 (HY000): Cannot add foreign key constraint
|
关系型数据库 MySQL
Mysql - 删除表时出现: Cannot delete or update a parent row: a foreign key constraint fails
Mysql - 删除表时出现: Cannot delete or update a parent row: a foreign key constraint fails
185 0
when click one item in table Select at least one column to perform the search
when click one item in table Select at least one column to perform the search
when click one item in table Select at least one column to perform the search
一个最简单的query view和对应的cube view
一个最简单的query view和对应的cube view
94 0
一个最简单的query view和对应的cube view
How to create CDS view to return Service order item detail data
You are asked to create a CDS view which must return the following information of Service order line item.
118 0
How to create CDS view to return Service order item detail data

热门文章

最新文章