|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Can anyone help in finding all the foriegn keys of a particular table and to which table and column it is referenced to?
Thanks Ram |
|
#2
|
|||
|
|||
|
Hi,
run the following from the application schema (if you are the dba replace the user_constraints with dba_constraints) select constraint_name from user_constraints where CONSTRAINT_TYPE='R' and table_name=<enter the name of your table>; regards, Galit. |
|
#3
|
|||
|
|||
|
Thanks,
But this will just get the constraint name of the table which is of type "r". Now this is just the name that I created, but how do I get the name of the fields in the other table to whom it is related? Ram Quote:
|
|
#4
|
|||
|
|||
|
SELECT a.table_name, a.column_name,
b.constraint_name, b.constraint_type FROM user_cons_columns a, user_constraints b, user_tab_columns c WHERE a.table_name = 'EMP' AND a.table_name = b.table_name AND b.table_name = c.table_name AND a.constraint_name = b.constraint_name AND a.column_name = c.column_name / |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Find the Foriegn Keys |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|