在oracle中可以使用pipelined来返回多条记录。
在postgresql中对应的功能是setof 表示返回多条记录。
网上的一个例子:
oracle supports pipelined functions. e.g a split function which takes in a string (a,b,c) and returns a b and c on multiple rows. can you advise on how to migrate such a function into enterprisedb?
postgresql:
对于以上例子的需求,可以使用现成的postgresql函数来解决:
如果用户只是有返回多行的需求,则可以使用returns setof来解决。
例如: