Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

multicolumn UPDATE with WITH clause

User_5OAFPJul 17 2012 — edited Jul 17 2012
is it possible to use existing query written with WITH clause as a source for multicolumn UPDATE statement? I have:
with x as ( rowid as rid, ... ), y as ( ... ), z as ( ... )
select x.rid, x.a ... z.a .. z.z
from x join y on x.a = y.a and .. x.z = y.z
     y left join z on y.a = z.a and .. y.z = z.z
I would like to have:
update BIG_X
set ( a, b, .... z ) =
select [ appropriate columns from above with ] from ( [ here comes above with statement ] ) small_x
where BIG_X.rowid = small_x.rid
but it doesn't work. I found some examples for single-column update but is there any way to do multicolumn update without using MERGE statement (which does allow to use WITH as source subquery)?

thank you
This post has been answered by John Spencer on Jul 17 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2012
Added on Jul 17 2012
10 comments
42,384 views