looping through results of a SELECT - Mailing list pgsql-sql

From Nagy Tamas
Subject looping through results of a SELECT
Date
Msg-id 20010127201542.A1794@cs.bme.hu
Whole thread Raw
List pgsql-sql
Hello!
I'd like to write a function, that makes some calculations
(perhaps applies another function) on every row of a result set returned
by a SELECT query. I thought writing a WHILE loop would work, but I
couldn't assign the individual rows to a variable. Then, I read about the
FETCH command, and I tried to use that, but it dies with 'error
near CURSOR' error when I try to use the function. I wrote a PL/PGSQL
function, obviously. So, my question is: is there an easy way to assign
the individual rows of a SELECT result to a variable in a function?
Thanks in advance,
Thomas Nagy


pgsql-sql by date:

Previous
From: Kovacs Baldvin
Date:
Subject: Architectural question
Next
From: Michael Davis
Date:
Subject: RE: looping through results of a SELECT