Specify the name of the table or view into which you want to insert the row(s). The table or view must be described in the CA Datacom Datadictionary, and must not be a CA Datacom Datadictionary table or any of the following types of views:
Specify the name of one or more columns for which you provide insert values. You can name the columns in any order. Each column must belong to the table or view you specified, and you cannot name the same column more than once. The column names must be separated by commas and the list must be enclosed with parentheses.
Introduces one row of values to be inserted. The values of the row are the values of the keywords, literals, or host variables specified in the clause. The values must be separated by commas and the list must be enclosed with parentheses.
When the statement is executed, the number of values in the VALUES clause must equal the number of names in the column list. The first value is inserted in the first column in the list, the second value in the second column, and so on.
See Special Registers for the special-register diagram. This is a CA Datacom/DB extension.
Specify a host-variable which must be a variable that is described in your program in accordance with the rules for declaring host variables.
Specify a literal consistent with the data type of the column.
Use the NULL keyword to specify that the value(s) being inserted are null values.
If you specify a subselect, the rows of the subselect's result table are inserted into the table or view you specified in the INSERT statement. The result can be one row, more than one row or no rows. If no rows are inserted, SQLCODE is set to +100. See Subselect for the subselect's syntax diagram.
The table or view named after INSERT INTO must not be named in a FROM clause of the subselect or the FROM clause of any subquery in the subselect.
The number of columns in the result table must equal the number of names in the column list. The value of the first column of the result is inserted in the first column in the list, the second value in the second column, and so on.
|
Copyright © 2014 CA.
All rights reserved.
|
|