Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: update multiple columns in pl/sql
On 13-Dez-97 18:17:43 Tlcbus wrote:
>To all:
Hello!
>Is there a better way to code the following statement ?
>A= a*b;
>B= a*b*c; A,B,C are calculated values.
>C=b*c;
>update tab set (col1,col2,col3) =(select A,B,C from dual);
>Thanks in advance, Ted Chyn
To be honest, I didn't know that the above works! :-) You could alternatively do the following:
update tab set
col1 = a*b, col2 = a*b*c, col3 = b*c;
Hope that helps,
Lothar
-- Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de Schulstr. 12 | lothar.armbruester_at_t-online.de D-65375 Oestrich-Winkel |Received on Sat Dec 13 1997 - 00:00:00 CST