Update multiple rows [message #435143] |
Mon, 14 December 2009 11:57  |
prachij593
Messages: 266 Registered: May 2009
|
Senior Member |
|
|
I am working in a temporary table.
Iinitially the table has data like this
root_id parent_id child_id col1 col2 col3
1 20 x
2 30 y
Now I have to fetch the value from other table such that it should be updated like this
root_id parent_id child_id col1 col2 col3
1 20 10 x 1
1 20 10 x 2
2 30 15 y 1
2 30 15 y 2
2 30 15 y 3
....
....
Is this possible with a update statement?
Thanks
|
|
|
Re: Update multiple rows [message #435144 is a reply to message #435143] |
Mon, 14 December 2009 12:00   |
 |
Michel Cadot
Messages: 68761 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Yes, No, Maybe, Most likely not, we don't know what is or is not in the "other table".
Post a working Test case: create table and insert statements along with the result you want with these data.
Also always post your Oracle version with 4 decimals.
Regards
Michel
[Updated on: Mon, 14 December 2009 12:01] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Update multiple rows [message #435151 is a reply to message #435149] |
Mon, 14 December 2009 12:43  |
 |
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
>I am using temp table for multiple updates and later will update the main table after computation
Nothing prevent underlying data to change between two events above.
With "same" data residing in multiple locations, eventually data gets changed in 1 place & not the other leading to inconsistent data reporting.
You get two different answers depending upon which data source is queried.
You are building an inefficient & unreliable application.
|
|
|