Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: update multiple columns in pl/sql

Re: update multiple columns in pl/sql

From: Lothar Armbruester <lothar.armbruester_at_rheingau.netsurf.de>
Date: 1997/12/13
Message-ID: <608.286T1039T12553238@rheingau.netsurf.de>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US