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

Home -> Community -> Usenet -> c.d.o.misc -> PS/SQL for constructing binary tree for pedigree?

PS/SQL for constructing binary tree for pedigree?

From: James Petts <jpetts_at_celltech.co.uk>
Date: 1997/12/05
Message-ID: <3487FAFD.34BF@celltech.co.uk>#1/1

I'm about to start writing an Oracle app for a horse breed society stud book. One of the things I need to do is to be able to construct a pedigree chart going back a given number of generations. Thus, each horse record will have a mother and a father field, each of which references the PK of another horse record. If the mother and/or father is unknown the appropriate field will be NULL.

What I need is to take as input the maximum number of generations to trace back, and construct a binary tree of the ancestors of the horse going back that number of generations by recursively getting the parents of the previous generations.

Before I sit down and try and code something up myself, doesn anybody have a routine that will do this sort of thing or perhaps a reference for an appropriate algorithm?

-- 
James "I'd rather fall off Ilustrada than ride any other horse" Petts
Received on Fri Dec 05 1997 - 00:00:00 CST

Original text of this message

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