| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Creating a Hierarchical Structure
>> how would I insert new "persons" into the tree. <<
Find the parent node ('mom', a, b) under which the new node appears. Make him the rightmost node ('kid', b+1, b+2), and update all lft and rgt values greater than (b).
>> For my application each node, must have a maximum of four
sub-nodes. <<
CREATE TABLE Tree
(node CHAR(10),
lft INTEGER NOT NULL UNIQUE,
rgt INTEGER NOT NULL UNIQUE,
CHECK(lft < rgt),
CHECK (MOD(((rgt - lft +1)/ 2), 5) = 0);
Received on Wed Sep 12 2001 - 10:44:07 CDT
![]() |
![]() |