Re: return rows question

From: Joe Conway <mail(at)joeconway(dot)com>
To: Laurette Cisneros <laurette(at)nextbus(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: return rows question
Date: 2002-06-15 02:20:41
Message-ID: 3D0AA479.6030505@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Laurette Cisneros wrote:
> Thanks. I had looked into this. But, it's not quite what I was looking
> for.
>
> I am writing a set of functions to act as an api to access data in the
> database. There are times when I would need to return a set of rows or
> even a set of text from a pl/pgsql function based on some logic (no such
> thing as logic in SQL).
>
> Any ideas?
>
> Thanks for the help,
>
> L.

Sorry, but even in current development sources, PL/pgSQL cannot return a
set (or at least if it can, I can't figure out how). I'm hoping to
change that before 7.3 is released, but at this point I haven't even
looked at it too hard.

You might look at having your function return a refcursor. See:
http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html
section 23.7.3.3. Returning Cursors. The URL is for the 7.3 development
docs, but I think the example shown will work in 7.2.x.

Joe

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Parul Agarwal 2002-06-15 10:20:06 JDBC problem
Previous Message James Buszard-Welcher 2002-06-15 02:18:48 oracle to postgresql