Joe Celko Function

Поиск
Список
Период
Сортировка
Искать
От
Ben-Nes Michael
Тема
Joe Celko Function
Дата
в 07:58:51
Msg-id
001d01c1f107$8ed0d3c0$aa0f5ac2@canaan.co.il
Список
Дерево обсуждения
Re: Joe Celko Function Fran Fabrizio <ffabrizio@mmrd.com>
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 по дате отправления
От: pgsql-gen Newsgroup (@Basebeans.com)
Дата:
Сообщение: Re: Failed compile on Sun
От: Fran Fabrizio
Дата:
Сообщение: Re: Joe Celko Function
FAQ