3. Statements : OpenROAD SQL Statements : Insert Statement
 
Share this page                  
Insert Statement
This statement inserts rows into a database table.
This statement has the following syntax:
[repeated] insert into tablename [(columnname {, })]
          values(expression{, expression}) | subselect;
The insert statement inserts new rows into the specified database table.
When you specify columnname, you must specify any column that is defined “not null not default.” If you do not specify such columns, you receive an error and the statement is not executed. Columns that are nullable or defaultable can be specified or not, as appropriate. If unspecified, they receive default values. (OpenROAD default values are null if the column is nullable, or blank for character data type columns and zero for numeric columns.)
The repeated keyword directs the database to encode and save the query execution plan, providing performance benefits if you intend to execute this statement more than once. Valid only for the Ingres DBMS.
Do not use the repeated keyword if your statement uses a dynamic name for the table name, a column name, or in the subselect clause.
For more information about the insert statement, see the Programming Guide.