Re: [INTERFACES] Use ecpg - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] Use ecpg
Date
Msg-id 19990128195859.B513@gmx.net
Whole thread Raw
In response to Re: [INTERFACES] Use ecpg  (James Thompson <jamest@math.ksu.edu>)
List pgsql-interfaces
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!

pgsql-interfaces by date:

Previous
From: markh@clockworkweb.com (Mark Himsley)
Date:
Subject: Re: [INTERFACES] varchar() access
Next
From: Michael Meskes
Date:
Subject: Re: [INTERFACES] Use ecpg