Re: function returning a cursor and a scalar - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: function returning a cursor and a scalar
Date
Msg-id 20090713182130.GG4930@alvh.no-ip.org
Whole thread Raw
In response to function returning a cursor and a scalar  ("Surajit Bhattacharjee" <surajitb@virtusa.com>)
Responses Re: function returning a cursor and a scalar
List pgsql-sql
Surajit Bhattacharjee wrote:
> I am new to Postgresql and am trying to write a function which will do a
> search and return the first page of results along with the total number
> of matches. How can I make my function return a cursor AND a scalar -
> can I do the scalar as an OUT param and then make the function
> explicitly RETURN a refcursor?

Why wouldn't you just use two OUT params?

BTW how do you plan on returning the number of matches?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-sql by date:

Previous
From: Oliveiros
Date:
Subject: Re: simple join is beating me
Next
From: "Surajit Bhattacharjee"
Date:
Subject: Re: function returning a cursor and a scalar