returning a cursor from a function?

From: Matthew Hixson <hixson(at)poindextrose(dot)org>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: returning a cursor from a function?
Date: 2006-02-01 06:37:47
Message-ID: B7F00468-94C7-4906-A3E9-E83EA3898795@poindextrose.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a create function statement that works with Oracle 8i and I'm
trying to create this function in Postgres 8.1.2.

CREATE OR REPLACE FUNCTION pr_user( p0 CHAR ) RETURN
Types.cursor_type IS
rs Types.cursor_type;
BEGIN
OPEN rs FOR
SELECT us.approval_type_code AS us_approval_type_code FROM wbs_users
us WHERE upper( us.username ) = upper( p0 );
return rs;
END;

Could someone lend me a hand here?
Thanks in advance,
-M@

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-02-01 06:55:42 Re: returning a cursor from a function?
Previous Message nboutelier 2006-02-01 04:42:41 Equivalent of a RECORD[] data type used in a function?