| From: | Igor Roboul <igor(at)raduga(dot)dyndns(dot)org> |
|---|---|
| To: | pgsql-general(at)hub(dot)org |
| Subject: | functions which return tuples |
| Date: | 2000-10-27 04:23:42 |
| Message-ID: | 20001027082342.A23496@linux.rainbow |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hello,
Is it possible write stored procedure (sorry, function) which will
return tuples one by one. Like:
select * from my_func(1,2,3);
1 Ivan
2 Petr
3 Irzi
etc.
Like in, for example, Interbase (this is completely unnatural proc):
create procedure find_something_for(p integer, w integer)
returns (k integer, t varchar(30) )
as
begin
for select n,v from t001 into :k,:t do
begin
if(n>10) then suspend;
end
end
'suspend' will return result to caller and then execution will continue
from saved position.
This is needed when computations is much harder than comparision n and 10
--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jason Earl | 2000-10-27 04:43:11 | Re: binary data and TEXT |
| Previous Message | Lamar Owen | 2000-10-27 03:48:56 | Re: [GENERAL] 7.0 vs. 7.1 (was: latest version?) |