Re: cursors and for loops?

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Dennis" <pg-user(at)calico-consulting(dot)com>, "postgres SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cursors and for loops?
Date: 2004-04-13 08:31:09
Message-ID: 200404130931.09295.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sunday 11 April 2004 19:46, Dennis wrote:
> Tom Lane writes:
> > Something like
> >
> > LOOP
> > FETCH ...;
> > EXIT WHEN NOT found;
> > ...
> > END LOOP;
>
> Thank you! I tried finding documentation on "found" in this context and
> didn't come up with anything. Can you point me to where it is documented?

In my 7.3.x docs, at the end "Basic statements" section of the "plpgsql"
chapter. There is only one sentence on it.

> Also, I am not getting the results I think I should be getting. Is there
> any kind of debug setting, or if not that, a way to output text (i.e.
> printf) from plpgsql?

RAISE NOTICE ''var1 = %, var2 = %'', var1, var2;

Note - you need this format, you can't mix and match expressions etc.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Laura Scott 2004-04-13 12:49:39 relation X does not exist
Previous Message Greg Stark 2004-04-13 06:20:00 Re: trigger/for key help