Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Use ecpg

From: James Thompson <jamest(at)math(dot)ksu(dot)edu>
To: Margarita Barvinok <brita(at)math(dot)lsa(dot)umich(dot)edu>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Use ecpg
Date: 1999-01-28 16:36:30
Message-ID: (view raw or whole thread)
Lists: pgsql-interfaces
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
> code ( I took it from a book) and get this error message:
> prog:17: parse error
> Perhaps this is stupid error, but I have no idea what to do, because I
> don't have good manual on Embedded SQL. Can I find somewhere
> documentation on C-Embedded SQL?

I'm kinda in the same boat.  I've been using the Oracle Pro*C precompiler
manual.  I don't have the URL here at work but I found an online copy

>   /* set error handler to bail out if we can't connect */
>     {                                            /* LINE 17     */
>     printError();
>     return FAILURE;
>     };

I don't think this will work.  I think you need to define an action for
the ecpg parser.  I asked one of the authors about the sqlerror option and
here's a snippet from the e-mail I got this morning


> interested in the actions to whenever sqlerror.  I tried to look in the
> preproc.y file but I have no idea what I'm looking at.  I saw a DO and
> a CALL but can't find out what they mean.

The following actions are defined:

goto label
go to label
do break
do function(parameter)
call function(parameter)


For me, the best documentation has been the test progs bundled in the
postgresql distro.  From memory the location is


or something like that. There are two test programs and a preformace

Hope this helps.  I you'd be so kind, mail me and let me know how things
work out, I'm working on error handling tonight.

James Thompson    138 Cardwell Hall  Manhattan, Ks   66506    785-532-0561 
Kansas State University                          Department of Mathematics

In response to


pgsql-interfaces by date

Next:From: Byron NikolaidisDate: 1999-01-28 17:03:34
Subject: [Fwd: [INTERFACES] Use Declare/Fetch option]
Previous:From: Margarita BarvinokDate: 1999-01-28 15:16:00
Subject: [INTERFACES] Use ecpg

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group