Hi All
Im trying to build set of function too handle nested tree structure, so I
used Joe Celco (SQL 4 Smarties).
I have some problem migrating one of his function to plpgsql function
This function suppose to close gaps relaying on some views.
I had two problems:
1. the while - how to migrate it
2. what is frammis ? some special variable in other db ? ( it just appeared
in this function and there is no mention to it in the chapter of nested tree
stracture ).
BEGIN
WHILE EXISTS ( SELECT * FROM gaps )
LOOP UPDATE frammis
SET rgt = CASE WHEN rgt > ( SELECT MIN(start) FROM gaps )
THEN rgt - 1 ELSE rgt END,
lft = CASE WHEN lft > ( SELECT MIN(start) FROM gaps )
THEN lft - 1 ELSE lft END;
END WHILE;
Cheer
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------