Arun
Arun

Reputation: 1

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

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.

Upvotes: 0

Views: 471

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247665

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.

Upvotes: 1

Related Questions