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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -