🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #515

Re: Using a variable replacement in SQL

#515
From: Bob Knapp
Date: Fri, 04 Sep 1998 00:00
42 lines
1782 bytes
Dear Romain,

  Thank you for the second time you have been able to solve a problem for me.
Your
SQL solution was the only one that worked. I think its time you wrote a book
on  Visual Dbase.

Thanks Again,
Bob Knapp

Romain Strieff [TeamB] wrote:

> 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: <35EFD41F.4EFA4102@erols.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35ED6C73.CA7B92E@erols.com> <MPG.1058bf50a555555798b144@forums.borland.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: Bob Knapp <nectel@erols.com>
Subject: Re: Using a variable replacement in SQL
Date: 1998/09/04
Message-ID: <35EFD41F.4EFA4102@erols.com>
X-Deja-AN: 387812598
Content-Transfer-Encoding: 7bit
References: <35ED6C73.CA7B92E@erols.com> <MPG.1058bf50a555555798b144@forums.borland.com>
To: teamb@opto-pps.com
Content-Type: text/plain; charset=us-ascii
Organization: NecTel
Mime-Version: 1.0
Newsgroups: borland.public.vdbase.data.sql