From: Michael Meskes <meskes@postgresql.org>
To: Matthew Denny <mdenny@cs.berkeley.edu>
Cc: pgsql-interfaces@postgresql.org
Cc: pgsql-novice@postgresql.org
Subject: Re: Change the table in a DELETE statement in ECPG
Date: Tue, 2 May 2000 20:05:37 +0200
Message-ID: <20000502200537.A602@fam-meskes.de> (raw)
In-Reply-To: <14602.9252.43161.647508@caracas.CS.Berkeley.EDU>
References: <14602.9252.43161.647508@caracas.CS.Berkeley.EDU>
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: meskes@postgresql.org, mdenny@cs.berkeley.edu, pgsql-novice@postgresql.org
Subject: Re: Change the table in a DELETE statement in ECPG
In-Reply-To: <20000502200537.A602@fam-meskes.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox