Created
November 14, 2011 14:01
-
-
Save terrancesnyder/1364004 to your computer and use it in GitHub Desktop.
Foreign Keys in Oracle Schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.table_name, a.column_name, uc.table_name, uc.column_name | |
FROM all_cons_columns a | |
JOIN all_constraints c ON a.owner = c.owner | |
AND a.constraint_name = c.constraint_name | |
JOIN all_constraints c_pk ON c.r_owner = c_pk.owner | |
AND c.r_constraint_name = c_pk.constraint_name | |
join USER_CONS_COLUMNS uc on uc.constraint_name = c.r_constraint_name | |
WHERE C.R_OWNER = 'CLIP_DEV' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment