Re: BSC
Re: BSC
От:
Vladimir Terziev <vlady@school.digsys.bg>
Дата:
Hi, I have a function written in plpgsql. I want that function to return a list of values (as SQL returns rows of a table). How can I do this? Vladimir
Re: [SQL] Re: BSC
От:
Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
Дата:
> I want that function to return a list of values (as SQL returns rows of a > table). > > How can I do this? I am afraid you cannot. Only one row can be returned with the type OPAQUE. Usually I write a "SELECT functionname(arguments);" query to solve this problem. The other solution can be that you create a table (outside your plpgsql function), then fill it out with INSERT statements inside the plpgsql function. I did not manage to create a table inside the function and I could not do a few important other things (e.g. CREATE USER, sub-SELECT), but with a little help of additional sql language functions was enough for my problem. You can find a quite complicated implementation of partially ordered sets on ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz/Linux/PostgreSQL/strukturak/ Here you can find po.sql, this is a basic English translation of the Hungarian reszbenrendezes.sql file. The table "po" stores only the Hasse diagram of the partially ordered set. If you find it worthful, I am glad to contribute it. I hope it does not work too slow. (Table "po" should be indexed.) Zoltan
Re: [SQL] Re: BSC
От:
Peter Eisentraut <e99re41@DoCS.UU.SE>
Дата:
On Wed, 16 Feb 2000, Vladimir Terziev wrote: > I have a function written in plpgsql. > > I want that function to return a list of values (as SQL returns rows of a > table). > > How can I do this? You can't. -- Peter Eisentraut Sernanders vaeg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden