Oracle sql updating multiple tables
You can wrap your around your more than one UPDATE statement in a single transaction, this way if one or more statement fails, the entire transaction rolls back.Here is the sample example of how the transaction should work with multiple update statements.We need to add two columns to the author table, Notice that the new columns are at the end of the AUTHOR table.All current rows in the table now contain NULLs for the new columns.For any SQL Server Performance Tuning Issue send an email at [email protected]
For example, we discover that we need to keep a record of the last date that each author published and what they published.
If you omit the WHERE clause, all records in the table will be updated!
The WHERE clause specifies which record(s) that should be updated.
In this scenario, accounting only sent me two records, but in the real life situation I ran into, it was over 10,000 records.
Also, this scenario’s master table has only 5 records; my real master table has close to 1,000,000 records.