Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA02255 for ; Sun, 20 Jun 1999 11:52:14 -0400 (EDT) (envelope-from Michael.Meskes@gmx.net) Received: from clubserv.rp-online.de (root@clubserv.rp-online.de [149.221.232.11]) by trends.net (8.8.8/8.8.8) with ESMTP id IAA14403 for ; Sun, 20 Jun 1999 08:55:50 -0400 (EDT) Received: from tanja.fam-meskes.de (as14-106.rp-plus.de [149.221.92.106]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id OAA18584 for ; Sun, 20 Jun 1999 14:45:47 +0200 (METDST) Received: (from meskes@localhost) by tanja.fam-meskes.de (8.9.3/8.9.3/Debian/GNU) id LAA02176 for pgsql-interfaces@postgresql.org; Sun, 20 Jun 1999 11:23:19 +0200 Date: Sun, 20 Jun 1999 11:23:19 +0200 From: Michael Meskes To: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] parse bind execute Message-ID: <19990620112319.E2076@gmx.net> Mail-Followup-To: pgsql-interfaces@postgresql.org References: <3.0.5.32.19990618162935.00931100@poptop.llnl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <3.0.5.32.19990618162935.00931100@poptop.llnl.gov>; from Steven Bradley on Fri, Jun 18, 1999 at 04:29:35PM -0700 On Fri, Jun 18, 1999 at 04:29:35PM -0700, Steven Bradley wrote: > I'm writing C programs to access a PostegreSQL database usng the libppq > interface. I am new to Postgres, so please excuse me if my question is too > basic. > > I want to preparate (parse) and SQL insert statement and then in a loop, > bind the input variables and execute. Is this possible using libpq or any > other Posgres interface from C? It is possible via ecpg the embedded SQL preprocessor for C. But be aware that the PREPARE statement is only simulated since the backend does not support it. That means you can do what you saif, but in fact everytime you issue your INSERT it is parsed by the backend yet again. 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!