Re: cursors and for loops?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dennis" <pg-user(at)calico-consulting(dot)com>
Cc: "postgres SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cursors and for loops?
Date: 2004-04-11 16:00:55
Message-ID: 15008.1081699255@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Dennis" <pg-user(at)calico-consulting(dot)com> writes:
> I am wondering if I can use a cursor in a for loop.

Something like

LOOP
FETCH ...;
EXIT WHEN NOT found;
...
END LOOP;

should do it.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message elein 2004-04-11 18:20:42 Re: SQL challenge--top 10 for each key value?
Previous Message Stephan Szabo 2004-04-11 15:17:52 Re: trigger/for key help