Re: FW: Extracting data based on foreign key relationships only

Re: FW: Extracting data based on foreign key relationships only

 

  

There is some possible catch. There is no mechanism in oracle whatsoever
to prevent you
to define foreign keys in style A -> B-> C -> A or even A -> A. Even
more: sometimes you
make some definition like that deliberately. Stuff like that will show
up as a serious point
for infinite error loops.

If you do not have cycles in your FK, you can create some view over
dba_tables,
dba_constraints and dba_cons_columns using CONNECT BY PRIOR. However
it is easiest way to define some PL/SQL block to do the job.

KAzi



Ian Evans wrote:
> Thought I would send this out again for a try, had no replies on it.
>
> -----Original Message-----
> From: Ian Evans
> [mailto:oracledba-ezmlmshield-x34941643.[Email address protected]
> Sent: Thursday, 13 March 2008 1:13 PM
> To: LazyDBA Discussion
> Subject: Extracting data based on foreign key relationships only
>
> Is there a popular method or sql script somewhere that I can use to pull
> data from a schema that has a significant relationship structure using
> just foreign keys?
>
> Obviously I have a parent table populated and data is connected
> downstream via an extensive relationship of foreign keys. If I can
> tease out one thread at a time and collect and cascade of rows that
> would be useful.
>
> I guess it's a bit like using the cascade delete "function" but for read
> purposes.
>
> I know third party products can be configured to do this, but thought
> there may be some good work done by DBAs or Oracle that may have been
> published for common use.
>
> Thanks in advance, Ian Evans.
>
> Notice:
>
> This e-mail and any attachments are confidential
> and may contain legally privileged information
> and/or copyright material of Hansen Technologies
> Limited or third parties. Copying, distributing,
> disclosing, commercialising or otherwise acting in
> reliance on this e-mail and any attachments is
> strictly prohibited unless you are the addressee of
> this e-mail and have written permission to do so. If
> you have received this e-mail in error please
> delete this e-mail (including any copies and
> attachments) and contact Hansen Technologies
> Limited by return e-mail or by telephone on + 61 3
> 9840 3000. Any views expressed in this e-mail are
> those of the individual sender and may not
> necessarily reflect the views of or be a
> commitment by the organisation, except where the
> individual sender has the authority and expressly
> states them to be so.
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
> Notice:
>
> This e-mail and any attachments are confidential
> and may contain legally privileged information
> and/or copyright material of Hansen Technologies
> Limited or third parties. Copying, distributing,
> disclosing, commercialising or otherwise acting in
> reliance on this e-mail and any attachments is
> strictly prohibited unless you are the addressee of
> this e-mail and have written permission to do so. If
> you have received this e-mail in error please
> delete this e-mail (including any copies and
> attachments) and contact Hansen Technologies
> Limited by return e-mail or by telephone on + 61 3
> 9840 3000. Any views expressed in this e-mail are
> those of the individual sender and may not
> necessarily reflect the views of or be a
> commitment by the organisation, except where the
> individual sender has the authority and expressly
> states them to be so.
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>



Oracle LazyDBA home page