<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Foreign Keys Table! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994575#M779288</link>
    <description>hi pinki,&lt;BR /&gt;&lt;BR /&gt;to add to above reply, here is the SQL that you should run:&lt;BR /&gt;select a.table_name, b.table_name"is being referenced by"&lt;BR /&gt;from all_constraints a, all_constraints b&lt;BR /&gt;where a.constraint_name = b.R_CONSTRAINT_NAME&lt;BR /&gt;and a.owner='&amp;amp;Table_Owner'&lt;BR /&gt;and a.table_name='INSTITUTION'&lt;BR /&gt;&lt;BR /&gt;You will be prompted to enter the owner of the table INSTITUTION&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
    <pubDate>Wed, 02 Aug 2006 23:19:32 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2006-08-02T23:19:32Z</dc:date>
    <item>
      <title>Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994568#M779281</link>
      <description>Hi everyone,&lt;BR /&gt;&lt;BR /&gt;   im working with Orcale9i and im having a little problem.&lt;BR /&gt;   i need to know all the tables which have a foreign key to an table. I find out a table with all tables, comments, columns, columns_comments ( all_tables, all_tab_comments, all_col_comments), i also find a table withh all constraints but there is no informatio about the table that constraint is refered. I need to know if there is a table with this information? Can anyone help me or guide me to find out this information, please? i will be very greatfull&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;&lt;BR /&gt;Pinki</description>
      <pubDate>Tue, 01 Aug 2006 11:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994568#M779281</guid>
      <dc:creator>Pinki Meggi</dc:creator>
      <dc:date>2006-08-01T11:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994569#M779282</link>
      <description>Hi Pinki,&lt;BR /&gt;&lt;BR /&gt;SELECT DISTINCT table_name&lt;BR /&gt;FROM sys.dba_constraints&lt;BR /&gt;WHERE constraint_name LIKE 'FK_%';&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Tue, 01 Aug 2006 12:32:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994569#M779282</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-08-01T12:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994570#M779283</link>
      <description>hi Pinki,&lt;BR /&gt;&lt;BR /&gt;unless you are systematic in naming your foreigh key constraints as 'FK_xxx' the above query might not work.&lt;BR /&gt;&lt;BR /&gt;if you only want to know the table names, the following will do it:&lt;BR /&gt;select table_name&lt;BR /&gt;from all_constraints&lt;BR /&gt;where constraint_name in (select R_CONSTRAINT_NAME&lt;BR /&gt;from all_constraints)&lt;BR /&gt;&lt;BR /&gt;The following data dictionary views may also be of help:&lt;BR /&gt;all_constraints&lt;BR /&gt;all_cons_columns&lt;BR /&gt;&lt;BR /&gt;if fact can be any of (all_, user_ or dba_)&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj &lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2006 00:04:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994570#M779283</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-08-02T00:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994571#M779284</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Thanks for your attention and response..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Well i think i didnt explain well what i need.&lt;BR /&gt;&lt;BR /&gt;I dont want to know foreign keys of one table. What i need is, for example: I have three tablea: Employee, Department and Institution. Employee and Department have foreign keys to Institution. I need a script that finds all the tables which have a foreign key that point to Institution.&lt;BR /&gt;&lt;BR /&gt;I hope you understand....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;&lt;BR /&gt;Pinki</description>
      <pubDate>Wed, 02 Aug 2006 08:18:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994571#M779284</guid>
      <dc:creator>Pinki Meggi</dc:creator>
      <dc:date>2006-08-02T08:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994572#M779285</link>
      <description>Hi,&lt;BR /&gt;something along the lines as produced by TOAD when clicking on the 'used by' tab?</description>
      <pubDate>Wed, 02 Aug 2006 09:04:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994572#M779285</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-08-02T09:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994573#M779286</link>
      <description>Hi Pinki,&lt;BR /&gt;&lt;BR /&gt;I think this is what you want. It searchs all tables in an owner that is referenced in another table:&lt;BR /&gt;&lt;BR /&gt;select dc.table_name, dc.owner &lt;BR /&gt;from dba_constraints dc&lt;BR /&gt;where dc.constraint_type = 'R'&lt;BR /&gt;and exists (select 1 from dba_constraints dc2&lt;BR /&gt;     where dc2.constraint_name = dc.r_constraint_name&lt;BR /&gt;     and dc2.constraint_type = 'P')&lt;BR /&gt;and dc.owner = &lt;YOUR_SEARCH_OWNER&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes&lt;/YOUR_SEARCH_OWNER&gt;</description>
      <pubDate>Wed, 02 Aug 2006 09:16:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994573#M779286</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2006-08-02T09:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994574#M779287</link>
      <description>Pinki,&lt;BR /&gt;I think:&lt;BR /&gt;select a.table_name, b.table_name&lt;BR /&gt;from all_constraints a, all_constraints b&lt;BR /&gt;where a.constraint_name = b.R_CONSTRAINT_NAME&lt;BR /&gt;and a.owner='&lt;QUERY_OWNER&gt;'&lt;BR /&gt;order by 1,2;&lt;BR /&gt;&lt;BR /&gt;should work.&lt;BR /&gt;It shows the table and any table that reference it.&lt;/QUERY_OWNER&gt;</description>
      <pubDate>Wed, 02 Aug 2006 09:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994574#M779287</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-08-02T09:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994575#M779288</link>
      <description>hi pinki,&lt;BR /&gt;&lt;BR /&gt;to add to above reply, here is the SQL that you should run:&lt;BR /&gt;select a.table_name, b.table_name"is being referenced by"&lt;BR /&gt;from all_constraints a, all_constraints b&lt;BR /&gt;where a.constraint_name = b.R_CONSTRAINT_NAME&lt;BR /&gt;and a.owner='&amp;amp;Table_Owner'&lt;BR /&gt;and a.table_name='INSTITUTION'&lt;BR /&gt;&lt;BR /&gt;You will be prompted to enter the owner of the table INSTITUTION&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 02 Aug 2006 23:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994575#M779288</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-08-02T23:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Foreign Keys Table!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994576#M779289</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot. It works perfectly:&lt;BR /&gt;&lt;BR /&gt;  select a.table_name, b.table_name"&lt;BR /&gt;  from all_constraints a, all_constraints b&lt;BR /&gt;  where   a.constraint_name=b.R_CONSTRAINT_NAME&lt;BR /&gt;and a.owner='&amp;amp;Table_Owner'&lt;BR /&gt;and a.table_name='INSTITUTION';&lt;BR /&gt;&lt;BR /&gt;Thanks once again.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards!&lt;BR /&gt;&lt;BR /&gt;Pinki</description>
      <pubDate>Thu, 03 Aug 2006 04:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/foreign-keys-table/m-p/4994576#M779289</guid>
      <dc:creator>Pinki Meggi</dc:creator>
      <dc:date>2006-08-03T04:10:20Z</dc:date>
    </item>
  </channel>
</rss>

