[VSQL] Updating fields with value from itself

Christer Olsson christer at ljusaideer.se
Mon Mar 28 17:40:33 CST 2005


>On 3/28/05 5:24 PM, "Christer Olsson" <christer at ljusaideer.se> wrote:
>
>> Should I be able to update a field in a table with a calculated value with
>> something like:
>> 
>> UPDATE myTable SET myFld = (myFld - 10) WHERE myFld2 = 'x'
>> 
>> I want the field "MyFld" to be 10 less than it was before the Update.
>
>Yes Christer, this should work.

Well, it doesn't. It sets myFld to 0 in *all* records.

myFld = 10 + 20 set myFld to 10 in records with  myFld2 = 'x'
myFld = 20 + 10 set myFld to 20 in records with  myFld2 = 'x'

>Please note, in fact SUBJECT is related to VSQL but not to V4RB

OK. I changed it.
-- 

  *************************************************************
  Christer Olsson   PO Box 9160        Phone +46 40 25 85 85
  Ljusa Idéer AB    SE-200 39 Malmo    Fax +46 40 25 85 89
  Kantyxegatan 5    Sweden             http://www.ljusaideer.se


More information about the Valentina mailing list