Progress
SQL-89
Guide and Reference


INSERT INTO Statement

Adds new rows to a table.

SYNTAX
INSERT INTO table-name 
  [ ( column-list ) ]
  { VALUES ( value-list ) | SELECT-statement } 

table-name

The name of the table where you want to insert new rows.

( column-list )

The names of one or more columns where you want to insert values.

The syntax of column-list is as follows.

SYNTAX
column [ [ expression [ FOR n ] ] ]
  [ , column [ [ expression [ FOR n ] ] ]  ] 

If you specify a column list that omits one or more columns in the table, the omitted columns have null values. If you omit the column list, Progress/SQL assumes you want to insert the data into all columns in the target table in left-to-right order.

Each expression is an integer array subscript. To specify a subrange of an array you can specify FOR n, where n is an integer constant.

VALUES value-list

Specifies the values to insert into the table. Each value can be a literal, a defined Progress variable or field name, an expression, or the keyword NULL. You must enclose each character string literal in single or double quotation marks. Progress inserts the nth value in the VALUES clause into the nth column position in the INTO clause.

SELECT-statement

Selects values from columns in another table for insertion into the target table. For more information, see the SELECT StatementSELECT_Statement reference entry.

EXAMPLE

This example adds new rows into the employee table.

INSERT INTO Employee  
  (Emp_Num, Name, Job, Dept, Hiredate, Salary)
  VALUES (’1204’, ’Robins, Lynn’, ’Mgr’, ’Research’, NULL, NULL). 

NOTE

SEE ALSO

DELETE FROM Statement, FETCH Statement, SELECT Statement, UNION Statement, UPDATE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095