Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > INSERT >

Inserting into a Row Variable (ESQL/C, IDS, SPL)

The INSERT statement does not support a row variable in the Collection- Derived-Table segment. You can use the UPDATE statement, however, to insert new field values into a row variable. For example, the following ESQL/C code fragment inserts a new row into the rectangles table (which Inserting Values into ROW-Type Columns (IDS) defines):

EXEC SQL BEGIN DECLARE SECTION;
   row (x int, y int, length float, width float) myrect;
EXEC SQL END DECLARE SECTION;

...
EXEC SQL update table(:myrect) 
   set x=7, y=3, length=6, width=2;
EXEC SQL insert into rectangles values (12, :myrect);

For more information, see Updating a Row Variable (IDS, ESQL/C).

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]