Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Foreign keys data dictionary
No I don't like talking to myself, but I've found myself some way to do that
and wanna share with the ones interested in the same problem:
After a little talk with some friends I found out that this select on the data dictionary returns the desired information, altough I couldn't optimize the select, because I don't know the indexes of the data dictionary:
SELECT
fk.constraint_name,
fk.table_name,
cfk.column_name,
rk.table_name,
crk.column_name,
crk.position
FROM
user_cons_columns crk, user_constraints rk, user_cons_columns cfk, user_constraints fk
fk.constraint_type = 'R' and fk.table_name like '%SN%' and fk.constraint_name = cfk.constraint_name and fk.r_constraint_name = rk.constraint_name and rk.constraint_name = crk.constraint_name andcrk.position = cfk.position
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Dec 15 1998 - 05:35:23 CST
![]() |
![]() |