Thread: Return cursor
Hi! I need to return a cursor from a function/procedure? How can I do it? Thanks, CGS
CREATE FUNCTION reffunc2() RETURNS refcursor AS ' DECLARE ref refcursor; BEGIN OPEN ref FOR SELECT col FROM test; RETURN ref; END; ' LANGUAGE 'plpgsql'; On Mon, 2003-08-25 at 17:05, Carmen Gloria Sepulveda Dedes wrote: > Hi! > > I need to return a cursor from a function/procedure? > How can I do it? > > Thanks, > > CGS > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51
Carmen Gloria Sepulveda Dedes wrote: > Hi! > > I need to return a cursor from a function/procedure? > How can I do it? http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html Jan > > Thanks, > > CGS > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #