Received: from feivel.fam-meskes.de (postfix@h-62.96.165.134.host.de.colt.net [62.96.165.134]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA13060; Tue, 2 May 2000 14:16:01 -0400 (EDT) (envelope-from michael@fam-meskes.de) Received: by feivel.fam-meskes.de (Postfix, from userid 1000) id BC0652BBDD; Tue, 2 May 2000 20:05:37 +0200 (CEST) Date: Tue, 2 May 2000 20:05:37 +0200 From: Michael Meskes To: Matthew Denny Cc: pgsql-interfaces@postgresql.org, pgsql-novice@postgresql.org Subject: Re: Change the table in a DELETE statement in ECPG Message-ID: <20000502200537.A602@fam-meskes.de> Mail-Followup-To: Matthew Denny , pgsql-interfaces@postgresql.org, pgsql-novice@postgresql.org References: <14602.9252.43161.647508@caracas.CS.Berkeley.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.9i In-Reply-To: <14602.9252.43161.647508@caracas.CS.Berkeley.EDU>; from mdenny@cs.berkeley.edu on Fri, Apr 28, 2000 at 05:05:10PM -0700 X-Archive-Number: 200005/38 On Fri, Apr 28, 2000 at 05:05:10PM -0700, Matthew Denny wrote: > Is it possible to create a DELETE statement of the form: > > EXEC SQL DELETE FROM :foo; No. > Where foo holds a table name; I have tried declaring foo as both a > VARCHAR and a regular C string (char*, NULL-term.) but both seem to > generate a parse error. Is my only option to use dynamic SQL Yes. > statements (e.g with the PREPARE and EXECUTE commands)? Yes, that's how it is supposed to work. 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@Fam-Meskes.De | Use PostgreSQL!