Обсуждение: Opening and Fetching from a refcursor inside a function

Поиск
Список
Период
Сортировка

Opening and Fetching from a refcursor inside a function

От
"kumar"
Дата:
Dear Friends,
 
I am using Postgres 7.3.4 on Redhat linux
 
In one of my requirement, I am getting a cursor as input parameter.
I am trying to process the records inside this cursor and i am not able to do it. (Some thing like opening and fetching a cursor in SQL Server)
 
My approach is as follows.
 
fn_xyz(refcursor,int4) returns record
Declare
data ALIAS $1;
mview RECORD;
FOR mview IN FETCH ALL IN data
LOOP
//Process the records.
END LOOP;
 
Is this possible. Please shed some light.
 
Thanks
Kumar