Re: Reverse query to find Foreign Key

From: sybrandb <>
Date: Wed, 29 Oct 2008 01:42:17 -0700 (PDT)
Message-ID: <>

On 29 okt, 08:29, Clive <> 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

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