Last active
July 27, 2020 19:06
-
-
Save shawnz/e9cc0905db5e88081c85dfb475f2c9ba to your computer and use it in GitHub Desktop.
a plugin for SQL Developer to show foreign key references on tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<displays> | |
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE"> | |
<name><![CDATA[FK References]]></name> | |
<description><![CDATA[]]> | |
</description> | |
<tooltip><![CDATA[]]> | |
</tooltip> | |
<drillclass><![CDATA[null]]></drillclass> | |
<query> | |
<sql> | |
<![CDATA[select a.owner, | |
a.table_name, | |
a.constraint_name, | |
a.r_constraint_name, | |
decode(b.constraint_type,'P','Primary_Key','U','Unique',b.constraint_type) R_CONSTRAINT_TYPE, | |
a.delete_rule, | |
a.status, | |
a.deferrable, | |
a.validated, | |
a.generated, | |
a.bad, | |
a.rely, | |
a.last_change, | |
a.invalid, | |
a.view_related | |
from all_constraints a, all_constraints b | |
where a.constraint_type = 'R' | |
and b.constraint_name = a.r_constraint_name | |
and b.owner = a.r_owner | |
and b.table_name = :OBJECT_NAME | |
and b.owner = :OBJECT_OWNER | |
order by a.table_name, a.constraint_name]]> | |
</sql> | |
</query> | |
<display type="" style="" enable="true"> | |
<name><![CDATA[Columns]]></name> | |
<description><![CDATA[]]> | |
</description> | |
<tooltip><![CDATA[]]> | |
</tooltip> | |
<drillclass><![CDATA[null]]></drillclass> | |
<query> | |
<sql> | |
<![CDATA[select cols.column_name column_name, | |
cols.position column_position | |
from all_cons_columns cols | |
where cols.owner = :OWNER | |
and cols.constraint_name = :CONSTRAINT_NAME | |
order by cols.position]]> | |
</sql> | |
</query> | |
</display> | |
</display> | |
</displays> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment