|
Name | Add dependent child tables tab |
Rating |  |
Created On | 23-JUL-08 |
Category | XML Extensions |
Database Version | 10.2 |
Description | Following on from Sue Harper's blog entry about adding your own tabs to SQL Developer this example adds a tab to display all child tables that have a foreign key pointing to the Primary Key or a Unique Key in the context table.
Following the directions on Sue's blog about how to create your own tab http://sueharper.blogspot.com/2007/04/how-to-add-tabs-to-sql-developer.html
you can create your own tabs as required.
I wanted a tab that would show me all the child tables of the current table.
The structure of the XML file needed for this is as below
<items>
<item type="editor" node="TableNode" vertical="true">
<title><![CDATA[Child Tables]]></title>
<query>
<sql><![CDATA[
select table_name, constraint_name from dba_constraints
where constraint_type = 'R'
and r_constraint_name in
(select constraint_name
from dba_constraints
where upper(table_name) = upper(:OBJECT_NAME)
and constraint_type IN ('P', 'U'))
ORDER BY table_name]]></sql>
</query>
</item>
</items> |
|
|
|
Just started using SQL Developer and had no idea you could do this - thanks so much for the example and source info :) | 09-JUL-2009 12:46PM
 |
Congratulations !!! This is a very good example for practice, but I think it's better using ALL_CONSTRAINTS or USER_CONSTRAINTS instead of DBA_CONSTRAINTS :-) | 24-JUL-2008 04:47PM
 |
|
|
|