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 ?