Received: from feivel.fam-meskes.de (postfix@p3EE015E1.dip0.t-ipconnect.de [62.224.21.225]) by hub.org (8.9.3/8.9.3) with ESMTP id FAA29508 for ; Tue, 2 May 2000 05:38:02 -0400 (EDT) (envelope-from michael@fam-meskes.de) Received: by feivel.fam-meskes.de (Postfix, from userid 1000) id F1A1B2BCE3; Tue, 2 May 2000 11:23:12 +0200 (CEST) Date: Tue, 2 May 2000 11:23:12 +0200 From: Michael Meskes To: Matthew Denny Cc: pgsql-interfaces@postgresql.org Subject: Re: ECPG and WHENEVER statements Message-ID: <20000502112312.A3097@fam-meskes.de> Mail-Followup-To: Matthew Denny , pgsql-interfaces@postgresql.org References: <14592.44665.629100.20848@caracas.CS.Berkeley.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.9i In-Reply-To: <14592.44665.629100.20848@caracas.CS.Berkeley.EDU>; from mdenny@CS.Berkeley.EDU on Fri, Apr 21, 2000 at 12:56:29PM -0700 X-Archive-Number: 200005/19 [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!