Opening and Fetching from a refcursor inside a function

From: "kumar" <sgnerd(at)yahoo(dot)com(dot)sg>
To: "pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Opening and Fetching from a refcursor inside a function
Date: 2004-05-18 12:18:47
Message-ID: 010501c43cd2$4f7fa2a0$7502a8c0@hdsc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Field 2004-05-18 15:47:11 Very slow search using basic pattern matching
Previous Message T Ullas 2004-05-18 08:26:25 Any sql repository