Database Reference
In-Depth Information
Looking closely at the previous statement, observe these points:
The
target
table
(the
one
receiving
rows)
is
the
HISTORY_STUDIOTIME table.
The source table (the one sending rows) is the STUDIOTIME table.
The two tables are matched on the value of the STUDIOTIME_ID.
When both tables contain a row with matching STUDIOTIME_ID,
three columns in the HISTORY_STUDIOTIME table are updated
with values from columns in the STUDIOTIME table.
When only the STUDIOTIME table has a row, and there is no
matching row in the HISTORY_STUDIOTIME table, a row is
inserted into the HISTORY_STUDIOTIME table using values in
the STUDIOTIME table's row.
The MERGE command can be very useful in situations that otherwise
would require separate INSERT and UPDATE commands.
Note: Rows in the target table that do not match those in the source table
are not affected by a MERGE command.
This chapter has covered the Data Manipulation Language (DML),
comprising commands to change data in tables in an Oracle database. We
have covered the INSERT, UPDATE, DELETE, and MERGE commands.
The next chapter examines datatypes in detail.
Search WWH ::




Custom Search