RDB/VMS SQL INSERT — VMS SQLdev_2.0
INSERT INTO --+-> table-name --+-+------------------------------+-+
+-> view-name ---+ +-> ( -+-> column-name -+-> ) -+ |
+------ , <------+ |
+---------------------------------------------------------------+
+--> VALUES --> ( -++-> literal ---++-> ) -+
| |+-> parameter -+| |
| |+-> NULL ------+| |
| |+-> USER ------+| |
| +---- , <--------+ |
| +-------------------------------------+
| ++------------------------------------+-+-> ;
| +-> RETURNING DBKEY INTO parameter --+ |
| |
+--> select-expr ----------------------------+
Additional information available:
More Informationcolumn nameselect expr
More Information
The INSERT statement stores values in rows of a table.
column name
A list of names of columns in the table or view. You can list the columns in any order, but the names must correspond to those of the table or view. If you do not include all the column names in the list, SQL assigns a null value to those not specified, unless columns were defined with the NOT NULL clause in the CREATE TABLE statement. You must include in an INSERT statement all names of columns defined with the NOT NULL clause. Omitting the list of column names altogether is the same as listing all the columns of the table or view in the same order as they were defined.
RETURNING_DBKEY
Returns the database key (DBKEY) of the row being added. When the DBKEY value is valid, subsequent queries can use the DBKEY to access the record directly.
Additional information available:
INTO parameter
Inserts the database key (DBKEY) of the row to a specified parameter. The INTO parameter clause is not valid in interactive SQL.
select expr
A select expression that specifies a result table. The result table can contain zero or more rows. All the rows of the result table are added to the target table named in the INTO clause. The number of columns in the result table must correspond to the number of columns specified in the list of column names. If you did not specify a list of column names, the number of columns in the result table must be the same as the number of columns in the target table. The value of the first column in the result table is assigned to the first column of the target table, the second value to the second column, and so on. For more information on select expressions, see the online help topic on select_expr.
VALUES
The VALUES clause specifies a list of values to be added to the table as a single row. The values can be specified through literals, paramters, or the NULL or USER keywords. See Chapter 3 of the Reference Manual for more information about literals, parameters, and NULL and USER keywords. The number of values in the list must correspond to the number of columns specified in the list of column names. If you did not specify a column list, the number of values in the list must be the same as the number of columns in the table. The first value specified in the list is assigned to the first column, the second value to the second, and so on.