create table test_tbl (id int, name character varying(10));
insert test_tbl values(1,'A');
insert test_tbl values(2,'B');
insert test_tbl values(3,'C');
insert test_tbl values(4,'D');
insert test_tbl values(5,'F');
Теперь я хочу передать эту таблицу в качестве входного аргумента функции.
create function myfn (in tbl (how to define the table input))
as
return set of <some type>
begin
return query AS
select concat(id,name)
from test_tbl
where id in (select id from in_tbl);
end;
Как объявить входной аргумент табличного типа?Как вызвать эту функцию при вводе таблицы?
select * from myfn(<pass the table - test_tbl>);