Progress
Embedded SQL-92
Guide and Reference
INSERT Rows into a Table
An INSERT statement adds one or more rows to an existing table.
EXAMPLEThe following INSERT statement adds new customer ’Nyquist’ to the customer table:
INSERT a Single Row into a Table
When you use an INSERT statement in an ESQL program, you can use host variables to supply the values. The columns of the customer table listed in the INSERT statement are referred to as the column list. The host variables specified in the VALUES clause of the INSERT statement are referred to as the value list.
EXAMPLEIn the next example, the values for the host variables are determined with program logic, and inserted into the customer table using the INSERT statement:
INSERT Multiple Rows into a Table
To INSERT more than one row, execute an INSERT statement with a sub-query.
EXAMPLEThe following code fragment shows how to INSERT multiple rows from the customer table into the mn_customer table:
The mn_customer table must already exist before you can INSERT rows. The SELECT query expression option allows you to INSERT multiple rows at a time. The query expression must successfully return values for all the columns in the INSERT statement for the operation to succeed.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |