Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.170]) by postgresql.org (Postfix) with ESMTP id 5B0DC47545D for ; Sat, 20 Jul 2002 09:34:06 -0400 (EDT) Received: from [212.227.126.155] (helo=mrelayng1.kundenserver.de) by moutng0.kundenserver.de with esmtp (Exim 3.35 #2) id 17VuN6-000571-00; Sat, 20 Jul 2002 15:34:08 +0200 Received: from pd90274fe.dip0.t-ipconnect.de ([217.2.116.254] helo=fam-meskes.de) by mrelayng1.kundenserver.de with asmtp (Exim 3.35 #2) id 17VuN6-0001JS-00; Sat, 20 Jul 2002 15:34:08 +0200 Received: by fam-meskes.de (Postfix, from userid 1000) id D4B4CA6013; Sat, 20 Jul 2002 13:45:28 +0200 (CEST) Date: Sat, 20 Jul 2002 13:45:28 +0200 From: Michael Meskes To: Daniel Kelley Cc: pgsql-interfaces@postgresql.org Subject: Re: ecpg & host variables Message-ID: <20020720114528.GE1781@feivel.fam-meskes.de> Mail-Followup-To: Daniel Kelley , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Archive-Number: 200207/114 X-Sequence-Number: 2923 On Fri, Jul 19, 2002 at 05:02:53PM -0400, Daniel Kelley wrote: > EXEC SQL BEGIN DECLARE SECTION; > typedef struct { > int id; > char name[30]; > char dsc[1000]; > } rec_t; > > rec_t r; > EXEC SQL END DECLARE SECTION; Actually this will not work, but you can do the following: EXEC SQL BEGIN DECLARE SECTION; struct { int id; char name[30]; char dsc[1000]; } r; EXEC SQL END DECLARE SECTION; or use the EXEC SQL TYPE command to do a typedef so ecpg knows about it: EXEC SQL TYPE rec_r is struct { int id; char name[30]; char dsc[1000]; } > is there are facility that i might be missing that would allow me to use > our existing structures as host variables w/ postgres embedded sql? or am > i better off just skipping ecpg and coding directly with libpq? That will be much more work. ecpg was modelled in a way that pro*c apps should compile without much of a problem. Michael -- Michael Meskes Michael@Fam-Meskes.De Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!