Reference Guide > TDV SQL Script > SQL Script Statement Reference > INSERT
 
INSERT
The INSERT INTO statement is used in SQL Script to insert values into the columns of a table. Almost any INSERT statement can be used as a standalone SQL Script statement.
Variables are allowed in a SQL statement anywhere literals are allowed.
Syntax
INSERT INTO table_name[(column_A,column_X,...)]
  VALUES ('value1','value X',...);
Remarks
Specification of the column names is optional. The VALUES list contains comma-separated values for insertion into the specified columns.
The INSERT INTO statement can also be used to insert a complete row of values without specifying the column names. Values must be specified for every column in the table in the order specified by the DDL. If the number of values is not the same as the number of columns in the table, or if a value is not allowed for a particular data type, an exception is thrown.
The syntax of INSERT is extended to allow PIPE variables to be used where a table name is normally used. This is how rows are inserted into a PIPE. See PIPE Modifier.
Examples
PROCEDURE p1 (OUT result PIPE(C1 VARCHAR(256)) )
BEGIN
INSERT INTO result(C1) VALUES(some_variable);
END
 
PROCEDURE p2 ( )
BEGIN
INSERT INTO birthdays(person_name,"birth date",'annotation') VALUES('Chris Smith','2006-12-20','Last years gift:Watch');
END