Free Trial

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

Share this Page URL

6.1 Insertion and Deletion > 6.1 Insertion and Deletion - Pg. 162

6.1 Insertion and Deletion 151 every end tag that you find as you read the text from left to right. It is also handy for groupings whose data are gathered in a linear fashion; more on that later. 6.1 Insertion and Deletion Insertion and deletion are just modifications of the routines used in the stan- dard nested sets model. For example, to remove a subtree rooted at :my_ employee, you would use: CREATE PROCEDURE RemoveSubtree (IN my_employee CHAR(10)) LANGUAGE SQL DETERMINISTIC BEGIN ATOMIC DECLARE leftmost INTEGER; DECLARE rightmost INTEGER; -- remember where the subtree root was SET leftmost = (SELECT MIN(emp_seq)