Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 3: Path Enumeration Models > 3.7 Splitting up a Path String - Pg. 54

40 C H A P T E R 3 : PAT H E N U M E R AT I O N M O D E L S Assuming that we simply move everyone up a level in the tree, we can first remove that node emp_id from the Personnel_OrgChart table and then remove that emp_id from the paths of the other nodes. BEGIN ATOMIC DELETE FROM Personnel_OrgChart WHERE emp_id = :dead_guy; UPDATE Personnel_OrgChart SET path_string = REPLACE (path_string, :dead_guy, `'); END; There are other methods of rebuilding the tree structure after a node is deleted, as discussed earlier. Promoting a subordinate based on some criteria to the newly vacant position, leaving a vacancy in the organizational chart, and so forth are all options. They are usually implemented with some combination of node deletions and insertions. 3.6 Inserting a New Node