| Author |
Can we update multiple tables in a single update query?
|
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1160
|
|
Can we update multiple tables in a single update query?
|
No Kaustubh No Fun, Know Kaustubh Know Fun..
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
No. At least not in Oracle
|
[My Blog]
All roads lead to JavaRanch
|
 |
Bharath Raja
Ranch Hand
Joined: Jan 21, 2009
Posts: 111
|
|
Kaustubh G Sharma wrote:Can we update multiple tables in a single update query?
have you idea about triggers
|
Life is either daring something or nothing - Helen Keller
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1160
|
|
Yes i know lil bit about triggers but never used it
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3867
|
|
Christophe Verré wrote:No. At least not in Oracle 
But you can in MySQL. So it depends on your database.
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1160
|
|
Thanks .. Gotcha
|
 |
Martin Vajsar
Bartender
Joined: Aug 22, 2010
Posts: 2386
|
|
Christophe Verré wrote:No. At least not in Oracle 
It is certainly possible in Oracle using key-preserved views ("updatable joins"). See what Tom Kyte has to say about it.
Then there is the multitable insert, which is usually used in ETL processing (read input data once and insert it into many tables, avoiding multiple full scans over external tables for example).
|
 |
Martin Vajsar
Bartender
Joined: Aug 22, 2010
Posts: 2386
|
|
Bharath Raja wrote:have you idea about triggers 
Triggers may appear to be cool, but no, I wouldn't advise to use drivers. There is no execution order specified for triggers and once there are more than a handful of them, any troubleshooting is a nightmare.
Stored procedure would be much better way in this case, if someone wanted to implement the logic in the database.
|
 |
 |
|
|
subject: Can we update multiple tables in a single update query?
|
|
|