Re: [SQL] cursors in plpgsql

2003-09-17 Thread Tomasz Myrta
Releases before 7.4 are spotty about supporting backwards scan of complex queries --- if you have a join or aggregate in the query, it likely won't work, yielding either strange errors or wrong answers. It will work if the top plan node in the query is a SORT, though, so a possible workaround is to

Re: [SQL] cursors in plpgsql

2003-09-17 Thread Tom Lane
Tomasz Myrta <[EMAIL PROTECTED]> writes: > I wanted to use some select result several times in pl/pgsql function. > Neither move backward 1 in test; > nor > execute ''move backward 1 in test''; > doesn't work. Releases before 7.4 are spotty about supporting backwards scan of complex queri

[SQL] cursors in plpgsql

2003-09-17 Thread Tomasz Myrta
Hi I wanted to use some select result several times in pl/pgsql function. DECLARE test refcursor; x record; BEGIN open test for select... fetch test into x; while found loop ...work... fetch test into x; end loop; ...rewind cursor using move... fetch test... Neither move backward 10

Re: [SQL] Cursors in plpgsql

2001-04-17 Thread Josh Berkus
Preeti, > Is there a command in plpgsql similar to %NOTFOUND of oracle? Cursors are not currently supported for PL/pgSQL. There are plans to include them for and upcoming version of Postgres. But dont' wait your application on it. > i want to write a load script which takes each row from the

[SQL] Cursors in plpgsql

2001-04-16 Thread Preeti Kamble
Hi Is there a command in plpgsql similar to %NOTFOUND of oracle? i want to write a load script which takes each row from the temporary table, do some processing and insert into actual tables. Any idea how i can accomplish this??? thank you regards Preeti ---(end of bro