X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 07942D1B931 for ; Tue, 27 Apr 2004 13:17:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 63065-02 for ; Tue, 27 Apr 2004 13:17:30 -0300 (ADT) Received: from internet.csl.co.uk (internet.csl.co.uk [194.130.52.3]) by svr1.postgresql.org (Postfix) with ESMTP id A1CE0D1B911 for ; Tue, 27 Apr 2004 13:17:28 -0300 (ADT) Received: from euphrates.csl.co.uk (host-194-67.csl.co.uk [194.130.52.67]) by internet.csl.co.uk (8.12.8/8.12.8) with ESMTP id i3RGHM4A017235; Tue, 27 Apr 2004 17:17:22 +0100 Received: from kelvin.csl.co.uk by euphrates.csl.co.uk (8.9.3/ConceptI 2.4) id RAA18314; Tue, 27 Apr 2004 17:17:21 +0100 (BST) Received: from kelvin.csl.co.uk (localhost.localdomain [127.0.0.1]) by kelvin.csl.co.uk (8.12.8/8.12.8) with ESMTP id i3RGHJRC007712; Tue, 27 Apr 2004 17:17:19 +0100 Received: (from lkind@localhost) by kelvin.csl.co.uk (8.12.8/8.12.8/Submit) id i3RGHJ7H007708; Tue, 27 Apr 2004 17:17:19 +0100 From: Lee Kindness MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16526.34702.956516.581431@kelvin.csl.co.uk> Date: Tue, 27 Apr 2004 17:17:18 +0100 To: Kevin Cowley Cc: "'pbreen@computerpark.co.uk'" , "'pgsql-interfaces@postgresql.org'" Subject: Re: Application compile file using Embeded SQL in P In-Reply-To: References: X-Mailer: VM 7.07 under 21.4 (patch 12) "Portable Code" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/68 X-Sequence-Number: 4889 I don't think that's what Paul was asking... It might help if you post a small example program. I think you're talking about something like: int main(int argc, char **argv) { EXEC SQL BEGIN DECLARE SECTION; const char *target = "db"; const char *user = "username"; EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO :target USER :user; printf("sqlca.sqlcode: %ld\n", sqlca.sqlcode); return( 0 ); } which gives the following: lkind@kelvin:~% ecpg test.pgc lkind@kelvin:~% gcc -Wall -lecpg test.c lkind@kelvin:~% ./a.out sqlca.sqlcode: -402 So, if that's not what you have... L. Kevin Cowley writes: > Paul > > I've just checked and they're const char*. > > I also commented out my original EXEC SQL line and re wrote it as an > explicit connect and it compiled, so I started adding the variables back in > and it still compiles. > > I don't understand :-[ And I haven't changed the Makefile either. > > -----Original Message----- > From: Paul Breen [mailto:pbreen@computerpark.co.uk] > Sent: 27 April 2004 16:37 > To: Kevin Cowley > Cc: 'pgsql-interfaces@postgresql.org' > Subject: Re: [INTERFACES] Application compile file using Embeded SQL in > Postgres4.7.2 > > Hello Kevin, > > Are you sure that target & user are declared as string pointers (char *)? > > The only way I could get similar errors to those you describe was by > declaring target & user as simple char variables in ECPG's declare > section. > > I'm using gcc 3.3, Postgres 7.3.2 on SuSE 8.2. > > Regards - Paul > > > > > I'm trying to build an embedded SQL app in Postgres 4.7.2 and failing at > > the > > first hurdle - Postgres itself compiles, starts, executes with no > > problems. > > > > We're using gcc 3.2.2 on SLES 8 > > > > The problem I'm getting is that ecpg doesn't appear to able to generate > > compilable code for something as simple as > > > > EXEC SQL CONNECT TO :target USER :user; > > > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc: In function > > `Connect': > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc:378: warning: > > passing > > arg 2 of `ECPGconnect' makes integer from pointer without a cast > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc:378: too few > > arguments > > to function `ECPGconnect' > > > > This is not the only place this type of error occurs. Elsewhere I have > > > > EXCE SQL IMMEDIATE :stmt; > > > > Which gives > > > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc: In function > > `ExecuteQuery': > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc:447: warning: > > passing > > arg 2 of `ECPGdo' makes integer from pointer without a cast > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc:447: warning: > > passing > > arg 3 of `ECPGdo' makes integer from pointer without a cast > > /sandbox/cowleyke/src/SQL_Benchmarks/tst_postgres.pgc:447: warning: > > passing > > arg 4 of `ECPGdo' makes pointer from integer without a cast