Re: [SQL] Returning multiple rows in functions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Kief Morris <k(dot)morris(at)bitbull(dot)com>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] Returning multiple rows in functions
Date: 2000-03-06 16:24:37
Message-ID: Pine.LNX.4.21.0003061723580.362-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Kief Morris writes:

> I create the following function:
>
> create function getid (int4) returns text as 'select name from mytable
> where id = $1;' language 'sql';
>
> ... but it only returns the first matching row. Is there
> a way to return all the matching rows?

No. Perhaps making a view would fit your application.

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Karl Denninger 2000-03-06 16:46:19 Re: [SQL] index file's growing big
Previous Message Ross J. Reedstrom 2000-03-06 16:24:33 Re: [SQL] index file's growing big