How to rewrite a Postgres function to return a scalar value and a table value (instead of a refcursor)?

404 Views Asked by At

I have a function that returns two OUT parameters: one is a scalar value and the other is a refcursor.

I don't want to use refcursor as OUT parameter, since it is not compatible with power builder. I need that function to return one scalar value and a table.

1

There are 1 best solutions below

0
On

You cannot have a function return both a scalar and a table. It is either/or.

You could return a table with an added column that is the scalar and is the same for all result rows. Or write two functions.