Thread: Cursors in plpgsql

Cursors in plpgsql

From
"Preeti Kamble"
Date:
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


Re: Cursors in plpgsql

From
"Josh Berkus"
Date:
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 temporary
> table, do some processing and insert into actual tables. Any idea how
> i
> can accomplish this???

Yes.  Please see my post from last week called: "Re: [SQL] Calling plSQL
functions".

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Cursors in plpgsql

From
Hans-Jürgen Schönig
Date:
Currently no real cursors are supported - you can build a workaround using
a loop - this works in most cases.
I have found a doc (a very good one) that describes porting from Oracle to
Postgres - accidentally I have lost the link but I remeber that I have
found it on altavista with "+plpgsql +plsql +postgres +oracle" or something
like that.
   Hans



Re: Re: Cursors in plpgsql

From
"Richard Huxton"
Date:
From: "Hans-Jürgen Schönig" <hs@cybertec.at>

> Currently no real cursors are supported - you can build a workaround using
> a loop - this works in most cases.
> I have found a doc (a very good one) that describes porting from Oracle to
> Postgres - accidentally I have lost the link but I remeber that I have

You can get to it from http://techdocs.postgresql.org/ - one of Roberto
Mello's contributions IIRC

- Richard Huxton