开发者

Return both OUT parameters and a rowset

I would like to return both output parametrs and a rowset.

In DB2, I can accomplish this with the following, and opening a cursor before the stored procedure ended:

CREATE PROCEDURE rqstprtl开发者_如何学JAVA.getInfo (
    IN  id  BIGINT,
    OUT var1    CHAR(6),
    OUT var2    BIGINT
)
DYNAMIC RESULT SETS 1

I'm unsure how to accomplish the same thing with PostgreSQL functions. My understanding is that functions have a return type of record (or no return type) for functions that have output parameters, but I would also need a return type of setof record to return the rowset.


You can use a refcursor instead, so one OUT parameter should be a refcursor type.

Pavel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜