Re: [SQL] Cursor names in a self-nested function

2011-08-18 Thread Tom Lane
Pavel Stehule writes: > you can use a refcursor type > http://developer.postgresql.org/pgdocs/postgres/plpgsql-cursors.html It would suffice to explicitly set mycursor to null before doing the OPEN, thus instructing the system to assign a unique cursor name. CREATE FUNCTION test(id integer) RE

Re: [SQL] Cursor names in a self-nested function

2011-08-18 Thread Pavel Stehule
Hello you can use a refcursor type http://developer.postgresql.org/pgdocs/postgres/plpgsql-cursors.html Regards Pavel Stehule 2011/8/18 Kidd, David M : > Hi, > > I am trying to write a function that contains a cursorĀ and iteratively calls > itself. > > It isĀ along the lines of, > > CREATE FUN

[SQL] Cursor names in a self-nested function

2011-08-18 Thread Kidd, David M
Hi, I am trying to write a function that contains a cursor and iteratively calls itself. It is along the lines of, CREATE FUNCTON test(id integer) RETURNS TEXT AS $BODY$ DECLARE mycursor CURSOR FOR SELECT * FROM myfunction(id); newid INTEGER; out = TEXT; BEGIN out := ''; OPEN mycursor