pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <Michael.Meskes@gmx.net>
To: hoelc <hoelc@pd.jaring.my>
Cc: Michael Meskes <Michael_Meskes@topmail.de>
Cc: James Thompson <jamest@math.ksu.edu>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] facing problem with ecpg
Date: Thu, 11 Feb 1999 20:51:42 +0100
Message-ID: <19990211205142.A600@gmx.net> (raw)
In-Reply-To: <36C3087A.CD315794@pd.jaring.my>
References: <36BCE221.47837890@pd.jaring.my>
	<Pine.GSO.4.05.9902061850530.6735-100000@noether.math.ksu.edu>
	<19990207200346.A254@gmx.net>
	<36C3087A.CD315794@pd.jaring.my>

On Fri, Feb 12, 1999 at 12:42:34AM +0800, hoelc wrote:
> Hello,
> I've just upgrated my PostgreSQL system to version Postgres-6.4.2
> Now it has the *ecpg
> But I'm facing problem in using it, when I compile the C program with
>         cc -o tryecpg tryecpg.c -lecpg -lpq
> the compiler can't recognize the " exec sql ", and give error massage
>        Parse error before 'sql'

The exec sql should be there after running ecpg. ecpg is a preprocessor. You
have to feed you're source (should be named file.pgc BTW) through ecpg
before running cc. That is:

ecpg tryecpg.pgc
cc -o tryecpg tryecpg.c -lecpg -lpq

> What went wrong ?  Please advise.

If this was not the problem we need more details.

> Thanks for giving me the address for the Oracle Pre*C/C++ programmer's guide, it
> is a good reference.  But, it doesn't exactly reflect the ecpg, right?  Is there
> any reference and example program for how to use ecpg?

The reference is pretty outdated but the source comes with three examples.
Oracle's Pro*C manual however is a good reference for the syntac of embedded
SQL, although it does not comply with the standard on some parts.

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!



view thread (7+ messages)  latest in thread

Message-ID: <19990211205142.A600@gmx.net>
Permalink:  ../19990211205142.A600@gmx.net/
Also on:    postgresql.org/message-id/19990211205142.A600@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: Michael.Meskes@gmx.net, hoelc@pd.jaring.my, Michael_Meskes@topmail.de, jamest@math.ksu.edu
  Subject: Re: [INTERFACES] facing problem with ecpg
  In-Reply-To: <19990211205142.A600@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox