Re: Reverse query to find Foreign Key

From: sybrandb <sybrandb_at_gmail.com>
Date: Wed, 29 Oct 2008 01:42:17 -0700 (PDT)
Message-ID: <36457564-c539-458d-acc3-f765c4efa849@l42g2000hsc.googlegroups.com>


On 29 okt, 08:29, Clive <sak..._at_gmail.com> wrote:
> I have a ID primary key that is used across many tables as fk, I want
> to find a sql (run as sysadmin) that can find all tables who have that
> id as fk and change it to something else, maintaining all constraints
> and ref integrity etc. i.e. I want to change the fk value in all
> tables to something other pk.
>
> is there a simple query to do this?
>
> thanks

Please refer to
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5773459616034

The underlying package contains the SQL you require plus the code to change PKs

--
Sybrand Bakker
Senior Oracle DBA
Received on Wed Oct 29 2008 - 03:42:17 CDT

Original text of this message