Re: cursors and for loops? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: cursors and for loops?
Date
Msg-id 200404130931.09295.dev@archonet.com
Whole thread Raw
In response to Re: cursors and for loops?  ("Dennis" <pg-user@calico-consulting.com>)
List 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


pgsql-sql by date:

Previous
From: Greg Stark
Date:
Subject: Re: trigger/for key help
Next
From: Tom Lane
Date:
Subject: Re: trigger/for key help