how to return 0 rows in function

Поиск
Список
Период
Сортировка
От Tomas Macek
Тема how to return 0 rows in function
Дата
Msg-id alpine.LFD.0.99.0705181048420.12374@maca.fortech.cz
обсуждение исходный текст
Список pgsql-general
Hi, I have simplified function like this:

----------------
CREATE OR REPLACE FUNCTION f(varchar) RETURNS varchar AS $FUNC$
DECLARE
     addr ALIAS FOR $1;
BEGIN
     -- return NULL;
     -- return '';
END
$FUNC$ LANGUAGE 'plpgsql';
-----------------

This function is returning varchar and it always returns at least one row. How
can I make it to return 0 rows? Is it possible or not and how?
Returning NULL does not help (return NULL string in 1 row). Not to return a
value leads to error output.

Many thanks for help

Tomas



В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Problem with inherited tables vs query planning
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: how to return 0 rows in function