Neoview SQL Reference Manual (R2.2)
INSERT Statement
• “Syntax Description of INSERT”
• “Considerations for INSERT”
• “Examples of INSERT”
The INSERT statement is a DML statement that inserts rows in a table or view.
INSERT [NOMVLOG] [WITH NO ROLLBACK] INTO table [(target-col-list)] insert-source
target-col-list is:
colname [,colname]...
insert-source is:
query-expr [order-by-clause] | DEFAULT VALUES
query-expr is:
non-join-query-expr | joined-table
non-join-query-expr is:
non-join-query-primary | query-expr UNION [ALL] query-term
query-term is:
non-join-query-primary | joined-table
non-join-query-primary is:
simple-table | (non-join-query-expr)
joined-table is:
table-ref [NATURAL] [join-type] JOIN table-ref [join-spec]
|table-ref CROSS JOIN table-ref
table-ref is:
table [[AS] corr [(col-expr-list)]]
| view [[AS] corr [(col-expr-list)]]
| (query-expr) [AS] corr [(col-expr-list)]
| joined-table
join-type is:
INNER | LEFT [OUTER] | RIGHT [OUTER]
join-spec is:
ON search-condition
Syntax Description of INSERT
NOMVLOG
specifies that the operation will not be recorded in the log table. Once this option is used, a
materialized view will no longer be consistent with its base tables and re computing it
produces a different result.
WITH NO ROLLBACK
specifies that the transaction within which the delete statement is executing does not rollback
if a transaction aborts. If you specify this option when AUTOCOMMIT is set to OFF an error
code is generated. If AUTOCOMMIT is set to OFF, you can use the SET TRANSACTION
statement to enable the NO ROLLBACK option for the transaction. See “SET TRANSACTION
Statement” (page 166).
table
names the user table or view in which to insert rows. table must be a base table or an
updatable view. To refer to a table or view, use the ANSI logical name.
See “Database Object Names” (page 196).
(target-col-list)
names the columns in the table or view in which to insert values. The data type of each target
column must be compatible with the data type of its corresponding source value. Within the
list, each target column must have the same position as its associated source value, whose
INSERT Statement 121