pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: pgsql and cursor
3+ messages / 3 participants
[nested] [flat]

* pgsql and cursor
@ 2001-02-10 16:05 Najm Hashmi <najm@mondo-live.com>
  2001-02-09 18:24 ` Re: pgsql and cursor Jie Liang <jliang@ipinc.com>
  2001-02-09 21:17 ` Re: pgsql and cursor Ian Lance Taylor <ian@airs.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Najm Hashmi @ 2001-02-10 16:05 UTC (permalink / raw)
  To: pgsql-sql

Hi all, I am not sure If it is allowed to use cursor inside pgsql functions.
If it is possible, please someone could send exact synatx  how it is used. If
it is not allowed  is there a way arround it? I need to do some calculations
and then return this value as text.
Thanks in advance for all your help.
Najm




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql and cursor
  2001-02-10 16:05 pgsql and cursor Najm Hashmi <najm@mondo-live.com>
@ 2001-02-09 18:24 ` Jie Liang <jliang@ipinc.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jie Liang @ 2001-02-09 18:24 UTC (permalink / raw)
  To: Najm Hashmi <najm@mondo-live.com>; +Cc: pgsql-sql


I just know you can use implict cursor inside the plpgsql
e.g
declare
rec record;
begin
FOR rec IN select_clause LOOP
     statements
END LOOP;
end;


Jie LIANG

St. Bernard Software
Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.ipinc.com

On Sat, 10 Feb 2001, Najm Hashmi wrote:

> Hi all, I am not sure If it is allowed to use cursor inside pgsql functions.
> If it is possible, please someone could send exact synatx  how it is used. If
> it is not allowed  is there a way arround it? I need to do some calculations
> and then return this value as text.
> Thanks in advance for all your help.
> Najm
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql and cursor
  2001-02-10 16:05 pgsql and cursor Najm Hashmi <najm@mondo-live.com>
@ 2001-02-09 21:17 ` Ian Lance Taylor <ian@airs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Ian Lance Taylor @ 2001-02-09 21:17 UTC (permalink / raw)
  To: Najm Hashmi <najm@mondo-live.com>; +Cc: pgsql-sql

Najm Hashmi <najm@mondo-live.com> writes:

> Hi all, I am not sure If it is allowed to use cursor inside pgsql functions.
> If it is possible, please someone could send exact synatx  how it is used. If
> it is not allowed  is there a way arround it? I need to do some calculations
> and then return this value as text.

Cursors are not supported in PL/pgSQL.  (You can, however, use FOR to
loop over a query).

For a patch to add cursor support to PL/pgSQL, see
    http://www.airs.com/ian/pgsql-cursor.html

Ian



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-02-10 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-10 16:05 pgsql and cursor Najm Hashmi <najm@mondo-live.com>
2001-02-09 18:24 ` Jie Liang <jliang@ipinc.com>
2001-02-09 21:17 ` Ian Lance Taylor <ian@airs.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox