Re: ECPG and WHENEVER statements

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Matthew Denny <mdenny(at)CS(dot)Berkeley(dot)EDU>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: ECPG and WHENEVER statements
Date: 2000-05-02 09:23:12
Message-ID: 20000502112312.A3097@fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

[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(at)Fam-Meskes(dot)De | Use PostgreSQL!

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Meskes 2000-05-02 09:24:07 Re: NOTICE: BeginTransactionBlock and not in default
Previous Message Peter Mount 2000-05-02 08:11:08 RE: [HACKERS] Request for 7.0 JDBC status