Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple table update in Oracle

Tags:

join

oracle

Is it possible to update multiple tables in Oracle with a single query using join? If so, what is the syntax? My colleague said he had done it in MySQL.

Update- What I am trying to do is something like this

UPDATE table1 t1 JOIN table2 t2 ON t1.id = t2.id SET t1.column1 = 'ABC', t2.column2 = 'BCD' WHERE <condition>
like image 949
Joyce Babu Avatar asked Oct 13 '22 21:10

Joyce Babu


1 Answers

What problem are you trying to solve? You cannot use a single update statement in Oracle to update multiple tables, but it is possible using a "Instead-Of" trigger on a view.

like image 195
diederikh Avatar answered Oct 27 '22 20:10

diederikh