-
Re: Re: Question on Bulk Update
Originally posted by marist89
50 columns of the same table? How about:
Code:
update table_a a
set a.col3 = a.col1 + a.col2,
a.col4 = a.col3 + a.col7,
a.col34 = a.col69 + a.col54;
The reason I cannot have a single update statement is because we do divisions also and when the divisor is zero we want the result to be a null.
for example
update table_a a
set a.col3 = a.col1 + a.col2,
a.col4 = a.col3 * a.col7,
a.col34 = a.col69 / a.col54;
In the above example if col54 is zero or null the whole update will fail. We want the result to be a null in such a case. That is col34 should be a null when the divisor is zero.
Thanks
Ronnie
ronnie_yours@yahoo.com
You can if you think you can.
-
Re: Re: Re: Question on Bulk Update
update table_a a
set a.col3 = a.col1 + a.col2,
a.col4 = a.col3 * a.col7,
a.col34 = a.col69 / decode(a.col54,0,null,a.col54);
-
so this is just one table with 50 columns to be updated. I thought it was 50 tables to be updated.
so, you can do all the columns at once and it should only take about 20 minutes, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|