Received: from clubserv.rp-online.de (clubserv.rp-online.de [149.221.232.11]) by hub.org (8.9.2/8.9.1) with ESMTP id BAA28307 for ; Fri, 12 Feb 1999 01:06:41 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.meskes.de (as13-041.rp-plus.de [149.221.92.169]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id HAA11348 for ; Fri, 12 Feb 1999 07:06:04 +0100 (MET) Received: (from meskes@localhost) by pc63.meskes.de (8.9.1a/8.9.1/Debian/GNU) id HAA00461 for pgsql-interfaces@postgresql.org; Fri, 12 Feb 1999 07:06:52 +0100 Date: Fri, 12 Feb 1999 07:06:52 +0100 From: Michael Meskes To: PostgreSQL Interfaces Subject: Re: [INTERFACES] facing problem with ecpg Message-ID: <19990212070652.A408@gmx.net> Mail-Followup-To: PostgreSQL Interfaces Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i 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!