Neoview SQL Reference Manual (R2.3)
ASC | DESC
specifies the sort order. The default is ASC. For ordering the source table on a column
that can contain null, nulls are considered equal to one another but greater than
nonnulls.
DEFAULT VALUES
specifies a query expression of the form VALUES (DEFAULT, ... ). The value of each
DEFAULT is the default value defined in the column descriptor of colname, which
is contained in the table descriptor of table. Each default value is inserted into its
column to form a new row.
If you specify DEFAULT VALUES, you cannot specify a column list. You can use
DEFAULT VALUES only when all columns in table have default values.
[FOR] access-option ACCESS
specifies the access option required for data accessed and returned in the source table derived
from the evaluation of a query expression that is a SELECT statement. See “Data Consistency
and Access Options” (page 30).
READ COMMITTED
specifies that any data accessed and returned in the source table derived from the
evaluation of the query expression must be from committed rows.
SERIALIZABLE | REPEATABLE READ
specifies that the INSERT statement and any concurrent process (accessing the same data)
execute as if the statement and the other process had run serially rather than concurrently.
IN {SHARE | EXCLUSIVE} MODE
specifies that share or exclusive locks be used when accessing data specified by a SELECT
statement or by a table reference in the FROM clause derived from the evaluation of a query
expression that is a SELECT statement. The specified locks are also used when accessing the
index, if any, through which the table accesses occur.
Considerations for INSERT
You can specify GROUP BY using ordinals to refer to the relative position within the SELECT
list. For example, GROUP BY 3, 2, 1.
Authorization Requirements
INSERT requires authority to read and write to the table or view receiving the data and authority
to read tables or views specified in the query expression (or any of its subqueries) in the INSERT
statement.
Transaction Initiation and Termination
The INSERT statement automatically initiates a transaction if no transaction is active. Otherwise,
you can explicitly initiate a transaction with the BEGIN WORK statement. After a transaction is
started, the SQL statements execute within that transaction until a COMMIT or ROLLBACK is
encountered or an error occurs.
Self-Referencing INSERT and BEGIN WORK or AUTOCOMMIT OFF
A self-referencing INSERT statement is one that references, in the statement's insert-source,
the same table or view into what rows will be inserted (see “Examples of Self-Referencing Inserts”
(page 129)). A self-referencing INSERT statement will not execute correctly if either BEGIN WORK
or AUTOCOMMIT OFF is used unless the compiler's plan sorts the rows before they are inserted.
To prevent this problem, Neoview generates error 8107. If you want to use a self-referencing
INSERT statement, you should avoid the use of BEGIN WORK or AUTOCOMMIT OFF.
126 SQL Statements