How to use row values as function parameters

Поиск
Список
Период
Сортировка
От Andrus
Тема How to use row values as function parameters
Дата
Msg-id B47E614A2DB74E17B92A42DCFDD74AC9@dell2
обсуждение исходный текст
Ответ на Re: How to drop user if objects depend on it  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to use row values as function parameters  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: How to use row values as function parameters  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Table ko should used to pass parameters to crtKAIVE() function.
ko has always single row.

I tried

CREATE or replace FUNCTION public.crtKAIVE(
_doktyybid text default 'GVY'
)
RETURNS TABLE (
id integer
)
AS $f_crkaive$
select 1
$f_crkaive$ LANGUAGE sql STABLE;

create temp  table ko ( doktyyp text ) on commit drop;
insert into ko values ('G');
select * from ko, crtkaive(ko.doktyyp)

but got error

    ERROR:  function expression in FROM cannot refer to other relations of
same query level

How to fix this so that ko can used to pass parameters to crtkaive ?

Posted also in

http://stackoverflow.com/questions/37231624/how-to-use-table-row-values-as-function-parameters

Andrus.



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

Предыдущее
От: Boszormenyi Zoltan
Дата:
Сообщение: PG wire protocol question
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: How to use row values as function parameters