Whenever you insert into a table which has generated columns,
Query can be:
Single-row and multiple-row VALUES expressions
can include the keyword DEFAULT. Specifying DEFAULT for a column inserts the
column's default value into the column. Another way to insert the default
value into the column is to omit the column from the column list and only
insert values into other columns in the table. For more information, see
The DEFAULT literal is the only value which you can directly insert into a generated column.
When you want insertion to happen with a specific ordering (for example, in conjunction with auto-generated keys), it can be useful to specify an ORDER BY clause on the result set to be inserted.
If the Query is a VALUES expression, it cannot contain or be followed by an ORDER BY, result offset, or fetch first clause. However, if the VALUES expression does not contain the DEFAULT keyword, the VALUES clause can be put in a subquery and ordered, as in the following statement:
For more information about Query, see
The INSERT statement depends on the table being inserted into, all of the conglomerates (units of storage such as heaps or indexes) for that table, and any other table named in the statement. Any statement that creates or drops an index or a constraint for the target table of a prepared INSERT statement invalidates the prepared INSERT statement.