Created
December 12, 2011 19:59
-
-
Save mvaz/1468832 to your computer and use it in GitHub Desktop.
Getting metadata from oracle sql tables
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 --* | |
| col.table_name, col.column_name, cc.constraint_name , rel.table_name, rel.column_name | |
| from user_tab_columns col, | |
| user_cons_columns con, | |
| user_constraints cc, | |
| user_cons_columns rel | |
| where col.table_name = con.table_name | |
| and col.column_name = con.column_name | |
| and con.constraint_name = cc.constraint_name | |
| and cc.constraint_type = 'R' | |
| and cc.r_constraint_name = rel.constraint_name | |
| and con.position = rel.position | |
| ; | |
| select distinct table_name | |
| from user_tab_columns col | |
| where table_name not like 'BIN%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment