plpgsql - fetching from returned cursors - Mailing list pgsql-general

From k|p
Subject plpgsql - fetching from returned cursors
Date
Msg-id IFEALNEGLOIJHNCMHLILMEDHCBAA.m.e.meulemans@student.utwente.nl
Whole thread Raw
Responses Re: plpgsql - fetching from returned cursors  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Is something like this possible?
Because the way I wrote it now, nothing is FOUND from the FETCH and the loop is
exited.

CREATE OR REPLACE FUNCTION test(integer) RETURNS integer AS '
DECLARE
        my_cursor refcursor;
    my_row row;
BEGIN
    my_cursor = get_refcursor($1);

      LOOP
        FETCH my_cursor INTO my_row;
        EXIT WHEN NOT FOUND;
        RAISE DEBUG ''id: %'', my_row.id;
    END LOOP;
END;
' LANGUAGE 'plpgsql';


Thanks,
kip


pgsql-general by date:

Previous
From: Francisco J Reyes
Date:
Subject: Re: Dealing with complex queries
Next
From: "codeWarrior"
Date:
Subject: How many joins is too many joins....