HP Neoview SQL Reference Manual page 122

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

position is determined by the columns in the table derived from the evaluation of the query
expression (query-expr).
If you do not specify all of the columns in table in the target-col-list, column default
values are inserted into the columns that do not appear in the list. See
Settings" (page
If you do not specify target-col-list, row values from the source table are inserted into
all columns in table. The order of the column values in the source table must be the same
order as that of the columns specified in the CREATE TABLE for table. (This order is the
same as that of the columns listed in the result table of SELECT * FROM table.)
insert-source
specifies the rows of values to be inserted into all columns of table or, optionally, into
specified columns of table.
query-expr
specifies the query expression that generates the source table consisting of rows of values
to be inserted into the columns named in target-col-list, if specified, or into all the
columns of table by default. If no rows are returned in insert-source, no rows are
inserted into table. If query-expr is not a VALUES clause, the insert-source cannot
reference either table or any view based on table, or any base table or view on which
table is based.
The number of columns in the column list (or by default the number of columns in table)
must be equal to the number of columns in the source table derived from the evaluation
of the query expression. Further, the data type of each column in the column list (or by
default each column in table) must be compatible with the data type of its corresponding
column in the source table.
A single value within a VALUES clause can be a value expression, NULL, or DEFAULT.
If you specify DEFAULT within a VALUES clause, the value inserted is the DEFAULT
value defined for the target column or the system will generate a value if the column is
an IDENTITY column (see
value expression can also include DEFAULT as an operand; the value inserted is the
expression evaluated with the DEFAULT value. For example, DEFAULT + 50 can be an
expression in a row value constructor. Expressions are not allowed as values for IDENTITY
columns. See
The use of DEFAULT in a value expression is a Neoview SQL extension.
If you attempt to insert NULL into a column that is defined as NOT NULL or DEFAULT
into a column that is defined with NO DEFAULT, Neoview SQL returns an error.
For the description of value expressions, see
of query-expr, see
ORDER BY {colname | colnum [ASC[ENDING] | DESC[ENDING]] [,{colname | colnum}
[ASC[ENDING] | DESC[ENDING]]]...
determines the order of the rows in the source table derived from the evaluation of
query-expr and, therefore, the order of insertion into table. The query expression is
evaluated and the source table ordered before inserting any rows into the target table.
colname
is the name of a column in a table or view that is referenced by the query expression
and optionally qualified by a table, view, or correlation name; for example,
CUSTOMER.CITY. If a column has been aliased to another name, you must use the
alias name.
colnum
specifies a column by its position in the select list of the query expression. Use colnum
to refer to unnamed columns, such as columns in the derived table of a query
expression other than a table or view.
122
SQL Statements
191).
"Generating Unique Values For a Column" (page
"Generating Unique Values For a Column" (page
"SELECT Statement" (page
75).
"Expressions" (page
208). For the description
141).
"Column Default
75)). A

Advertisement

Table of Contents
loading

Table of Contents