Razzak and Albert, thanks for your responses.

Albert..  I tried your method and it works fine.

Razzak..  I tried to use the syntax that you provided and I receive a 2511
error (Illegal Select).  I am using the latest version of V8..  Is it
possible that the syntax only works with V9?

John

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak
Memon
Sent: Sunday, September 12, 2010 3:13 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Update command

At 11:25 AM 9/12/2010, John Engwer wrote:

>Is it possible to use the update command to update TABLE1
>using the sum of values from TABLE2?
>Such as.  UPDATE TABLE1 SET InStockQty = (SUM)T2.OnHand
>FROM TABLE1 T1,TABLE2 T2 WHE T1.MfgStyle = T2.StockNo


John,

Here's how to use a correlational UPDATE command in R:BASE:

Goal:

Update TableA (TableAColumn) from the SUM of values in TableB (TableBColumn)

Assumptions:

Both columns in each table are of similar data 
type, such as, BIGNUM, CURRENCY,
DOUBLE, INTEGER, NUMERIC, or REAL.

Command:

SET FEEDBACK ON
UPDATE TableA SET TableAColumn = (SUM(TableBColumn)) +
FROM TableB,TableA WHERE TableA.KeyColumn = TableB.KeyColumn
SET FEEDBACK OFF

That's all there is to it!

Very Best R:egards,

Razzak.


Reply via email to