Re: function returning a cursor and a scalar

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Surajit Bhattacharjee <surajitb(at)virtusa(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: function returning a cursor and a scalar
Date: 2009-07-13 18:21:30
Message-ID: 20090713182130.GG4930@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Emi Lu 2009-07-14 15:08:05 Request new version to support "on commit drop" for create temp table ... as select ?
Previous Message Oliveiros 2009-07-13 14:02:28 Re: simple join is beating me