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
using www.google.com
/* set error handler to bail out if we can't connect */
EXEC SQL WHENEVER SQLERROR
{ /* 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
<snip>
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:
continue
sqlprint
stop
goto label
go to label
do break
do function(parameter)
call function(parameter)
</snip>
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
or something like that. There are two test programs and a preformace
program.
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.