Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: hierarchical question - grabbing everything related

Re: hierarchical question - grabbing everything related

From: SpaceMarine <spacemarine_at_mailinator.com>
Date: Tue, 06 Nov 2007 08:18:41 -0800
Message-ID: <1194365921.300093.52530@d55g2000hsg.googlegroups.com>


On Nov 6, 9:52 am, SpaceMarine <spacemar..._at_mailinator.com> wrote:
> this is because the 3rd party app i am working with breaks if it comes
> across an orphaned row -- that is, if any rows reference a ParentID, i
> need to also have those parent-rows present. and if those parent-rows
> have parents, they need to be present... etc.

i think im going to try a different approach.. i what i need is a reverse hierarchy query. like so:

SELECT
    LEVEL,
    ObjectID,
    Name,
    ParentID AS ChildID

FROM
   tbl_Parts

START WITH (UPPER(v.Name) LIKE UPPER('test%'))

--CONNECT BY PRIOR ObjectID = ParentID
CONNECT BY PRIOR ParentID = ObjectID --swapped the relation around

ORDER SIBLINGS BY ObjectID;

...going to try that. Received on Tue Nov 06 2007 - 10:18:41 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US