Received: from clubserv.rp-online.de (root@clubserv.rp-online.de [149.221.232.11]) by hub.org (8.9.2/8.9.1) with ESMTP id BAA58752 for ; Fri, 29 Jan 1999 01:16:10 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.meskes.de (as13-002.rp-plus.de [149.221.92.130]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id HAA01238; Fri, 29 Jan 1999 07:15:46 +0100 (MET) Received: (from meskes@localhost) by pc63.meskes.de (8.9.1a/8.9.0/Debian/GNU) id TAA00560; Thu, 28 Jan 1999 19:58:59 +0100 Date: Thu, 28 Jan 1999 19:58:59 +0100 From: Michael Meskes To: James Thompson Cc: Margarita Barvinok , pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Use ecpg Message-ID: <19990128195859.B513@gmx.net> Mail-Followup-To: James Thompson , Margarita Barvinok , pgsql-interfaces@postgreSQL.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: ; from James Thompson on Thu, Jan 28, 1999 at 10:36:30AM -0600 On Thu, Jan 28, 1999 at 10:36:30AM -0600, James Thompson wrote: > On Thu, 28 Jan 1999, Margarita Barvinok wrote: > > > > > Hello All, > > > > I just began to use postgresql-6.4.2 and ecpg (version: 2.4.4). > > I try t precompile simple Strange. For some reason I've never seen the original mail. Seems that's just another of those typical usa.net mail losses. Could someone please forward it to me. Thanks. > > /* set error handler to bail out if we can't connect */ > > EXEC SQL WHENEVER SQLERROR > > { /* LINE 17 */ > > printError(); > > return FAILURE; > > }; Sorry, but that's incorrect syntax. What you want to do is: func() { printError(); return FAILURE; } EXEC SQL WHENEVER SQLERROR DO func(); BTW there is a function defined in libecpg named sqlerror() that prints a clear text error message. > ... > > For me, the best documentation has been the test progs bundled in the > postgresql distro. From memory the location is > > postgresql-6.4.2/src/interfaces/ecpg/test Yup. 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.Meskes@gmx.net | Use PostgreSQL!