From: Michael Meskes <meskes@postgresql.org>
To: Matthew Denny <mdenny@CS.Berkeley.EDU>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ECPG and WHENEVER statements
Date: Tue, 2 May 2000 11:23:12 +0200
Message-ID: <20000502112312.A3097@fam-meskes.de> (raw)
In-Reply-To: <14592.44665.629100.20848@caracas.CS.Berkeley.EDU>
References: <14592.44665.629100.20848@caracas.CS.Berkeley.EDU>
[I'm still behind with my mail, so please take my spologies if this already
has been answererd.]
On Fri, Apr 21, 2000 at 12:56:29PM -0700, Matthew Denny wrote:
> In my ECPG code, I have a EXEC SQL WHENEVER NOT FOUND DO BREAK
> statement in order to end a cursor fetch loop when the cursor runs out of
> input tuples. Unfortunately, it appears ECPG puts such a conditional
> break statement after every SQL EXEC in the file and then throws an
No, only after statements that may result in NOT FOUND. For instance it is
not set after a cursor close statement.
> error if these subsequent statements are not in a switch or loop
> statement (which most of my INSERT, UPDATE, and DELETE calls are not).
> Thus, I currently have to wrap all my INSERT, UPDATE, and DELETE
> calls in dummy switch statements. Is there a more elegant way
> (e.g. via another EXEC SQL WHENEVER statement) to toggle WHENEVER NOT
> FOUND DO BREAK at different points in the source file? A more elegnt
> solution would be greatly appreciated.
How about WHENEVER NOT FOUND BREAK before the loop and WHENEVER NOT FOUND
CONTINUE after it?
Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De | Use PostgreSQL!
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-interfaces@postgresql.org
Cc: meskes@postgresql.org, mdenny@CS.Berkeley.EDU
Subject: Re: ECPG and WHENEVER statements
In-Reply-To: <20000502112312.A3097@fam-meskes.de>
* 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