Article View: borland.public.vdbase.data.sql
Article #484Re: Variable in sql file
From: Steve Koterski
Date: Mon, 07 Dec 1998 00:00
Date: Mon, 07 Dec 1998 00:00
23 lines
1748 bytes
1748 bytes
On Sat, 05 Dec 1998 11:30:47 -0500, "David M. O'Neil"
<David@ONeilComputing.com> wrote:
>I need to run a sql flie that uses a variable field. The code is;
>
>SELECT Cust.CUSTOMER_N, :v.field
>FROM "customer.dbf" Cust, "Variables.dbf" v
>
>I want the statment in the sql file to use v.field to select the field
>to be used in customer. I receive the error "Error: Parameter not
>defined: v.field" Is there any way to do this with an sql file?
SQL supports the parameterizing of data values, but not of metadata object
names (tables, columns, etc.). You would need to do as Bowen advised in
another response in this thread: build your statement dynamically, as a
string, inserting the variable value.
//////////////////////////////////////////////////////////////////////////
Steve Koterski "What is success in this world? I would say
Technical Publications it consists of four simple things: to live
INPRISE Corporation a lot, to love a lot, to laugh a lot, and
http://www.inprise.com/delphi from it all, to learn a lot."
-- Richard J. Needham
Technical Details
Message-ID:
<36711f5e.7220743@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36695FB7.2CD700E3@ONeilComputing.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,c04ed0e0babc0dba X-Google-Attributes: gidff5a1,public From: skoterski@NOSPAMinprise.com (Steve Koterski) Subject: Re: Variable in sql file Date: 1998/12/07 Message-ID: <36711f5e.7220743@forums.inprise.com> X-Deja-AN: 419714180 Content-Transfer-Encoding: 7bit References: <36695FB7.2CD700E3@ONeilComputing.com> Content-Type: text/plain; charset=us-ascii Organization: INPRISE Corporation, Technical Publications Mime-Version: 1.0 Reply-To: skoterski@NOSPAMinprise.com Newsgroups: borland.public.vdbase.data.sql