Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to know if primary key is used as foreign key somewhere in database?

918207May 6 2012 — edited Aug 19 2012
Hi,

So is there a way to check that? I need to make that check from the code and disable delete action from web client.
Table in question is join table which joins two entities, service provider and country. If service provider is assigned to some country and that record is referenced from some other tables in data base, delete action should be forbidden.
Table holds three columns

CID | SERVICE_PROVIDER_ID | COUNTRY_ID

1 | 5 | 7
2 | 5 | 9
3 | 5 | 2
4 | 3 | 7
5 | 3 | 9

So, CID is the key which is referenced from other tables and program should check if it's being referenced.

Thank you!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2012
Added on May 6 2012
6 comments
3,297 views