Article View: borland.public.vdbase.data.sql
Article #506Re: Using a variable replacement in SQL
From: Romain Strieff [TeamB]
Date: Thu, 03 Sep 1998 00:00
Date: Thu, 03 Sep 1998 00:00
31 lines
1383 bytes
1383 bytes
In article <35ED6C73.CA7B92E@erols.com>, nectel@erols.com grudgingly admits... > > This command works fine from dbase : > > UPDATE DATA1.DBF SET VALUE1 = '1000' WHERE VALUE2 = 'TEST' > > All VALUE1 occurances are changed to 1000 when VALUE2 is equal to TEST. > > The problem is this: In the real world '1000' and 'TEST' are being sent > in as variables and changed all the time. > > If I set these values to variables it won't work . ie. TEMP1 = '1000' > , TEMP2 = 'TEST' > > UPDATE DATA1.DBF SET VALUE1=TEMP1 WHERE VALUE2=TEMP2 > > > I even tried to use &TEMP1 and &TEMP2 as well as '&TEMP1' and '&TEMP2'. > > Nothing seems to work and there is little or no information on how to > use SQL with a variable replacement. > > &Macro the whole line. cmd=[UPDATE DATA1.DBF SET VALUE1=']+TEMP1+[' WHERE VALUE2=']+TEMP2+['] &cmd. -- Romain Strieff [TeamB]
Technical Details
Message-ID:
<MPG.1058bf50a555555798b144@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35ED6C73.CA7B92E@erols.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,3529dd9d0cb9d0ba X-Google-Attributes: gidff5a1,public From: Romain@Do.not.reply.via.e-mail (Romain Strieff [TeamB]) Subject: Re: Using a variable replacement in SQL Date: 1998/09/03 Message-ID: <MPG.1058bf50a555555798b144@forums.borland.com> X-Deja-AN: 387508585 References: <35ED6C73.CA7B92E@erols.com> Organization: TeamB Reply-To: teamb@opto-pps.com Newsgroups: borland.public.vdbase.data.sql