INSERT command

This command inserts rows into a table.


INSERT INTO table_name
   [ (column_list)]
   { VALUES (constant_list)
Keyword Description
table_name Name of the table into which values are inserted
column_list Identifies the columns of the table into which the values are inserted. All columns not in the list receive their default values automatically. If any such column cannot receive defaults (for example, if they have the NOT NULL constraint, but have no other default value specified) the INSERT fails.

If you omit the list, all columns of the table are the target of the insert. The number and order in which you list the columns must match the number and order of the output columns of the corresponding query

constant_list A simple list of values to insert


This statement enters one or more rows into table_name. The rows are the output rows of the subquery. These rows must have the same data types as the columns being inserted into.

You must have INSERT privileges on all named columns to issue an INSERT statement. If the table is a view, this view must be updatable, in which case the new rows are inserted into the base table that contains the data from which the view is derived (the leaf underlying table).

The values to be inserted may be directly specified with a table value constructor (whose elements may include variables or parameters passed from applications) or derived from a query from information already present in the database.