pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Dennis <pg-user@calico-consulting.com>
To: postgres SQL <pgsql-sql@postgresql.org>
Subject: Re: cursors and for loops?
Date: Tue, 13 Apr 2004 09:31:09 +0100
Message-ID: <200404130931.09295.dev@archonet.com> (raw)
In-Reply-To: <courier.40799269.00004AC6@wolverine.lercnetworks.com>
References: <courier.4078D0C7.00000C8F@wolverine.lercnetworks.com>
	<15008.1081699255@sss.pgh.pa.us>
	<courier.40799269.00004AC6@wolverine.lercnetworks.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <200404130931.09295.dev@archonet.com>
Permalink:  ../200404130931.09295.dev@archonet.com/
Also on:    postgresql.org/message-id/200404130931.09295.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, pg-user@calico-consulting.com
  Subject: Re: cursors and for loops?
  In-Reply-To: <200404130931.09295.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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