And of course Anonymous is absolutely right. So I added 'U' as a constraint type option.
The other comment was from my much appreciated colleague Erik. He brought this to another level, by pointing me out how to add this as a User Defined Extension in SQL Developer.
I must say I was already quite pleased with the Snippets in SQLDeveloper. So I already added the query as a snippet:
He refered to a tip by Sue Harper that explains this (What, it's been in there since 2007?!).
Now what to do? First create an xml file, for instance referred_by_fks.xml, with the following content:
<items> <item type="editor" node="TableNode" vertical="true"> <title><![CDATA[FK References]]></title> <query> <sql> <![CDATA[select fk.owner, fk.table_name, fk.constraint_name, fk.status from all_constraints fk join all_constraints rpk on rpk.constraint_name = fk.r_constraint_name where fk.constraint_type='R' and rpk.constraint_type in('P','U') and rpk.table_name = :OBJECT_NAME and rpk.owner = :OBJECT_OWNER order by fk.table_name, fk.constraint_name;]]> </sql> </query> </item> </items>
Note that I updated my query a bit.
Then to add the extension to SQL Developer:
- Open the prefereces via: Tools > Preferences
- Navigate to Database > User Defined Extensions
- Click "Add Row" button
- In Type choose "EDITOR", Location is where you saved the xml file above
- Click "Ok" then restart SQL Developer
Now, if you click on a table in the navigater, you will have an extra tab on your table editor:
Cool stuff! And it's been there for ages!