ODBC Server Reference Manual

CORE SQL Language
HP NonStop ODBC Server Reference Manual429151-002
3-51
INSERT
INSERT
Use INSERT to add new rows to a table or a view.
The INSERT statement has the following syntax:
table-name
is the table into which the rows are inserted. The table-name can be qualified
with the database name and owner name. If table-name is a viewed table, the
INSERT statement inserts rows into the base table from which table-name is
derived; the view must be a NonStop SQL/MP protection view. For information
about protection views, see Shorthand Views and Protection Views on page 3-44.
The table table-name must be updatable.
column-identifier
specifies a column for which a value will be supplied. Omitting all column-
identifiers is equivalent to specifying all the columns of table-name, in
ascending order of their position in the table.
query-specification
is a SELECT statement that selects values from other tables and views to be
inserted in the table or view specified in the INTO clause.
If the INSERT statement contains a query-specification, it inserts one row of
values into table-name for each row of the derived table. The value of the first
column of a row in the derived table is inserted into the first specified column, the
second row value into the second specified column, and so on. The row must
contain an element for each column that you specify in the column-identifier
list.
The select-statement cannot refer to the table, view, or underlying table of the
view into which the rows are being inserted.
INSERT [ INTO ] table-name
[ ( column-identifier [, column-identifier ] ... ) ]
{ VALUES ( insert-value [‚ insert-value ] ... ) }
{ query-specification }
insert value is
[ dynamic-parameter ]
[ literal ]
[ NULL ]
[ USER ]