Re: [INTERFACES] Use ecpg

From: Michael Meskes <Michael_Meskes(at)usa(dot)net>
To: James Thompson <jamest(at)math(dot)ksu(dot)edu>
Cc: Margarita Barvinok <brita(at)math(dot)lsa(dot)umich(dot)edu>, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Use ecpg
Date: 1999-01-28 18:58:59
Message-ID: 19990128195859.B513@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Meskes(at)gmx(dot)net | Use PostgreSQL!

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message D'Arcy J.M. Cain 1999-01-28 22:20:23 Re: [INTERFACES] Python Interface
Previous Message Byron Nikolaidis 1999-01-28 18:51:28 Re: [INTERFACES] varchar() access