If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How to retrieve the Foreign key information in Oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-21-03, 04:00
kennypoon kennypoon is offline
Registered User
 
Join Date: Mar 2002
Posts: 25
How to retrieve the Foreign key information in Oracle

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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On