cursor question

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: cursor question
Date: 2009-02-25 15:53:22
Message-ID: 49A56972.3090709@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

short question. Why is this not possible:

CREATE OR REPLACE FUNCTION user_cursor_open(text) RETURNS refcursor AS $$
DECLARE
curs1 CURSOR FOR SELECT * FROM $1;
BEGIN
OPEN curs1;
RETURN curs1;
END; $$ LANGUAGE plpgsql;

Or, how do I set a parameter when using cursor?

Thanks in advance

- --
St.Pauli - Hamburg - Germany

Andreas Wenk

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJpWlyVa7znmSP9AwRAv2MAJ9jHICtLeIEv+QVzeqBWSkheXDmpgCgwMUH
t0/HWRPsx56jGhSVUQXyb9I=
=XMXi
-----END PGP SIGNATURE-----

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2009-02-25 15:54:16 Re: Warm standby failover mechanism
Previous Message Gregory Stark 2009-02-25 15:36:15 Re: Using xmin to identify last modified rows