Stephen:  I had the exact same question in my mind.  I always use aliases 
on
both table names.  Always.  Is it because this is updating a varchar 
(something
I don't think I've ever tried to do with a correlated update), or is it 
just something
to try if a "normal" correlated update produces an error?

Karen



In a message dated 8/31/2012 3:50:58 PM Central Daylight Time, 
[email protected] writes: 
> Hmm. I've always used a table alias for the updated table in a 
> multi-table UPDATE without a problem. Indeed, the final example in (9.1) help 
> for the 
> UPDATE command is:
> 
> UPDATE inventory SET onhand = (T1.onhand - T2.totalsold) +
> FROM inventory T1, orders_view T2 +
> WHERE T1.partid = T2.partid
> 
> Does this have something to do with the VARCHAR?
> 
> 
> Regards,
> 
> Stephen Markson
> The Pharmacy Examining Board of Canada
> 416.979.2431 x251
> 
> From: [email protected] [mailto:[email protected]] On Behalf Of Bill 
> Downall
> Sent: Friday, August 31, 2012 12:16 PM
> To: RBASE-L Mailing List
> Subject: [RBASE-L] - Re: Update problem
> 
> Tom,
> 
> Do not use a table alias (t1) for the table you are updating, use the full 
> name
> update CommonCode +
>   set CCData = t2.CCData, +
>     CCModified = t2.CCModified +
> from CommonCode, tmpCode t2 +
> where CommonCode.CCName = t2.CCName +
>    and CommonCode.CCModified <t2.CCModified
> 

Reply via email to