sql - how to update multiple columns in multiple tables -


how can update multiple columns in multiple tables in single query?

i tried below no success.


my tables

update class c, school s set c.status='absent', s.status='absent' c.id='&id' , c.id=s.id; 

any clues appreciable.

you can't direct update of multiple tables in oracle.

you might able update of view, this:

update ( select c.status class_status, s.status school_status class c, school s c.id='&id' , c.id=s.id ) set class_status='absent', school_status='absent' 

oracle allow if join between tables preserves keys - i.e. each row produced join directly maps single row in source table(s) being updated. suspect in case school not key-preserved each row in table relates more 1 row in class. won't able in single statement.

oracle far less tolerant of fuzzy relational thinking other systems.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -