SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
I-16
Considerations—INSERT
APPEND | ANYWHERE
specifies whether to add rows at the end of the table (APPEND) or anywhere in the
table (ANYWHERE). (Applies only to tables with relative file organization or to
protection views defined on such tables. Cannot be used if the SYSKEY column is
one of the columns for the INSERT.)
With APPEND, if you specify an ORDER clause in select-stmt, rows are added
in that order. With ANYWHERE, an ORDER clause in select-stmt has no
effect.
APPEND is the default unless the column list includes the SYSKEY.
Considerations—INSERT
INSERT requires authority to read and write to the table or view receiving the data
and authority to read tables and views specified in any select-stmt included in
the INSERT statement.
To insert a row, you must provide a value for each column in the table that has no
default value. (As a result, you cannot insert a row into a protection view unless the
view includes all columns of the underlying table that are defined with the NO
DEFAULT option.)
In addition to being of appropriate type and size for the corresponding columns, the
values in each row inserted must be compatible with the data types of the
corresponding columns:
Character values
Any character string data type is compatible with all other character string data
types that have the same character set.
For character columns, inserted values shorter than the column length are
padded on the right with single-byte ASCII blanks (HEX 20); longer values are
truncated on the right. For varying-length character columns, shorter inserted
values are not padded; values longer than the maximum length are truncated
on the right.
Numeric values
Any numeric data type is compatible with all other numeric data types.
If you insert a value into a numeric column that is not large enough, an
overflow error occurs.
If a value has more digits to the right of the decimal point than specified by the
scale for the column definition, the value is truncated.
INTERVAL values
An INTERVAL data type is compatible only with another INTERVAL data type
with the same range of INTERVAL fields.