Re: How to retrieve the Foreign key information in Oracle

From: Frank <fvanbortel_at_netscape.net>
Date: Wed, 21 May 2003 22:30:41 +0200
Message-ID: <3ECBE1F1.9000702_at_netscape.net>


Frank wrote:

> kennypoon wrote:
> 

>> I use this SQL statement
>> Select pka.table_name PK_Table_Name, pka.column_name PK_COLUMN_NAME,
>> pkc.table_name FK_TABLE_NAME, pkc.column_name FK_COLUMN_NAME from
>> user_cons_columns pka, user_constraints pkb, user_cons_columns pkc where
>> pkc.constraint_name = pkb.constraint_name and pkb.constraint_type='R'
>> and pka.constraint_name = pkb.r_constraint_name and pka.position =
>> pkc.position and pka.table_name = 'ABC' order by pka.table_name,
>> pka.column_name, pkc.table_name, pkc.column_name
>>
>> but the performance is too slow. Is any other statement which has much
>> better performance?
>>
>> --
>> Posted via http://dbforums.com
> 
> 
> Yes: select * from emp;
> 

seriously - post execution plans, sort_area (you have a group by!), etc. And joining views to views is never a good idea.

-- 
Regards, Frank van Bortel
Received on Wed May 21 2003 - 22:30:41 CEST

Original text of this message