Problem in Function returning Cursors - Postgres Sql 7.2

From: ramkumarm(at)npd(dot)hcltech(dot)com (Ramkumar)
To: pgsql-general(at)postgresql(dot)org
Subject: Problem in Function returning Cursors - Postgres Sql 7.2
Date: 2003-09-18 04:42:29
Message-ID: dc73a585.0309172042.603318a7@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In PostgreSql 7.2,
i have written one stored procedure using CURSORS.

CREATE FUNCTION reffunc3(refcursor) RETURNS refcursor AS '
BEGIN
OPEN $1 FOR SELECT empName FROM tbl_employee;
RETURN $1;
END;
' LANGUAGE 'plpgsql';
BEGIN;
SELECT reffunc('funccursor');
FETCH ALL IN funccursor;
COMMIT;

** Function is created successfully
** While executing the SELECT of function,it is returning the
Cursor
** While using the FETCH ALL IN Command ,it is simply saying
"Query Execuetd OK!"

How can i get the Result sets ?

Sudharsan

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2003-09-18 07:10:53 Re: Where are PL/pgSQL functions stored?
Previous Message Michael Garriss 2003-09-18 04:36:59 Re: varchar vs. text