Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group