ALLBASE/SQL Reference Manual (36216-90216)

Chapter 11 453
SQL Statements E - R
INSERT
input.
The BULK option used with host variables is available for C, COBOL, and FORTRAN
applications.
The BULK option used with an sqlda_type data structure is available for C and Pascal
applications.
Authorization — Insert Rows with SingleRowValues and Bulk
Values
If you specify the name of a table, you must have INSERT or OWNER authority for that
table or you must have DBA authority.
If you specify the name of a view, you must have INSERT or OWNER authority for that
view or you must have DBA authority. Also, the owner of the view must have INSERT or
OWNER authority with respect to the view's base tables, or the owner must have DBA
authority.
SQL Syntax — INSERT Rows Defined by a SELECT Command (Type
2 Insert)
INSERT INTO { [
Owner.
]
TableName
[
Owner.
]
ViewName
}[(
ColumnName
[,...])]
QueryExpression
Parameters — INSERT Rows Defined by a SELECT Command (Type
2 Insert)
[
Owner
.]
TableName
identifies the table to which data is to be added.
[
Owner
.]
ViewName
identifies a view on a single table; the data is added to the table
upon which the view is based. Refer to the CREATE VIEW command for
restrictions governing inserts via a view.
ColumnName
specifies a column for which data is supplied from the select list in the
SELECT command. Each column named must have a corresponding select
list item. You can omit the column name list if you provide a select list
item for all columns in the target table in the same order the columns were
specified in the CREATE TABLE (or CREATE VIEW) command.
QueryExpression
defines the rows to be inserted based on one or more tables and/or
views in the DBEnvironment. The name of the target table cannot appear
within the FROM clause or in a FROM clause of any subquery. The query
expression cannot contain an INTO clause or a union operation.
The data types of each column in the select list must be compatible with
the data types of corresponding columns in the target table. The first select
list item defines the first column in the target table, the second select list
item defines the second column in the target table, and so forth. The
number of select list items must equal the number of columns in the target
table.
Any column in the target table can contain null values only if it was not