如何从Postgres中的存储过程返回集合(多行)?

时间:2019-05-09 16:36:28

标签: postgresql

我有以下要求

调用一个带有ID表的过程,并从PG中的另一个表获取匹配的记录。 例如:

CALL PROC_A(<input will be table type>, out < table type>)

CREATE PROC_A (in input <some_tbl_type>, inout output <some_tbl_typ>)
AS $$

    out = select some columns 
          from <some_tbl>
          where id in (select id from input)

$$;

如何在Postgres中执行此操作?我只想使用PROCEDURE而不起作用。

以便我可以将现有代码迁移到PG。

0 个答案:

没有答案
相关问题