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 HAA70690 for ; Sat, 10 Apr 1999 07:52:10 -0400 (EDT) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.rp-plus.de (as11-asy34.rp-plus.de [149.221.93.162]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id NAA00716 for ; Sat, 10 Apr 1999 13:51:25 +0200 (METDST) Received: (from meskes@localhost) by pc63.rp-plus.de (8.9.3/8.9.0/Debian/GNU) id MAA02080 for pgsql-interfaces@postgresql.org; Sat, 10 Apr 1999 12:01:04 +0200 Date: Sat, 10 Apr 1999 12:01:04 +0200 From: Michael Meskes To: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Questions about pq library and ecpg Message-ID: <19990410120104.E2048@gmx.net> Mail-Followup-To: pgsql-interfaces@postgresql.org References: <99032716072200.01169@zeman> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Herouth Maoz on Sun, Mar 28, 1999 at 06:37:28PM +0200 On Sun, Mar 28, 1999 at 06:37:28PM +0200, Herouth Maoz wrote: > It can easily be done with libpq, though. Instead of what you wrote above, > you simply have to build the query correctly: > > strcpy( str, 'table_name' ); > > sprintf( query, "INSERT INTO %s VALUES ('%s', %d)", str, "Rome", 10 ); > > result = PQexec( conn, query ); Which is essantially the same as exec sql execute immediate :query; :-) 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!