Joe Celko Function
От | Ben-Nes Michael |
---|---|
Тема | Joe Celko Function |
Дата | |
Msg-id | 001d01c1f107$8ed0d3c0$aa0f5ac2@canaan.co.il обсуждение исходный текст |
Ответы |
Re: Joe Celko Function
|
Список | pgsql-general |
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 --------------------------
В списке pgsql-general по дате отправления: