Database Reference
In-Depth Information
DELETE.
Eliminate a row.
MERGE
. Insert all the rows in one table into another table that
already has existing rows. If the key of the incoming row matches an
existing row, update the existing row instead of inserting a new row.
Note:
MERGE was a new feature of Oracle Database 9
i
. The MERGE
command is improved in Oracle Database 10
g
.
Note:
Data Definition Language (DDL) commands are SQL commands
that modify the structure of the database (the database metadata) by adding,
removing, or changing tables, views, or other objects (see Chapters 18 to 23).
Here are some pointers that are common for all DML commands:
DML commands are usually executed against a single table at a time.
The only exceptions to this rule are rare multiple-table inserts, a vari-
ation of the INSERT command and the MERGE command. Multi-
ple-table inserts are typically used for repetitive data warehouse
Denormalization or logical archiving of table rows into separate his-
torical tables or partitions.
You must have permission to use DML commands on tables that you
do not own (see Chapter 23). For this chapter, assume you always
own the tables you are working on, so you automatically have the
privileges needed.
Oracle Database enforces constraints defined for the table (such as
unique primary key values) whenever you use DML commands on a
table. Constraints are rules that the database keeps track of for each
table you create. Chapter 20 covers constraints in detail.
One constraint that you will see very often is the NOT NULL con-
straint, placed on a column. This means that no row in the table can
have a null value in any column with a NOT NULL constraint. The
DESCRIBE command tells you whether the column has a NOT
NULL constraint or not. If it says NOT NULL, the column cannot
contain any null values. Otherwise, it can contain null values.
Search WWH ::




Custom Search