X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 730F9D1CA3F for ; Tue, 18 May 2004 09:19:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 74178-09 for ; Tue, 18 May 2004 09:18:42 -0300 (ADT) Received: from chn-dns.primus-india.net (chn-dns.primus-india.net [203.196.153.7]) by svr1.postgresql.org (Postfix) with ESMTP id AD16ED1B4C9 for ; Tue, 18 May 2004 09:18:34 -0300 (ADT) Received: from ivesia67 (ptil-138-190-chn.primus-india.net [203.196.190.138] (may be forged)) by chn-dns.primus-india.net (8.12.8/8.12.8) with SMTP id i4IBAL5M011311 for ; Tue, 18 May 2004 16:40:31 +0530 Message-ID: <010501c43cd2$4f7fa2a0$7502a8c0@hdsc.com> From: "kumar" To: "pgsql" Subject: Opening and Fetching from a refcursor inside a function Date: Tue, 18 May 2004 17:48:47 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0102_01C43D00.5EAA7420" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200405/154 X-Sequence-Number: 17868 This is a multi-part message in MIME format. ------=_NextPart_000_0102_01C43D00.5EAA7420 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 ------=_NextPart_000_0102_01C43D00.5EAA7420 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Friends,
 
I am using Postgres 7.3.4 on Redhat=20 linux
 
In one of my requirement, I am getting a c= ursor as=20 input parameter.
I am trying to process the records inside this cursor a= nd i=20 am not able to do it. (Some thing like opening and fetching a cursor in SQL= =20 Server)
 
My approach is as follows.
 
fn_xyz(refcursor,int4) returns=20 record
Declare
data ALIAS $1;
mview RECORD;
FOR mview IN F= ETCH=20 ALL IN data
LOOP
//Process the records.
END LOOP;
 
Is this possible. Please shed some=20 light.
 
Thanks
Kumar
------=_NextPart_000_0102_01C43D00.5EAA7420--