Previous Topic: Update StatementsNext Topic: Delete Statements


Insert Statements

To UPDATE and SELECT data from a table, the data for that table must already have been added to the table. To add an employee to the EMPLOYEE table, formulate an INSERT statement like this:

INSERT INTO EMPDB.EMPLOYEE
(OFFICE_CODE_0450,
DEPT_ID_0410,
EMP_ID_0415, ...)
VALUES (WST, 411, 512, ...);

Because the DEPT‑EMPLOYEE and OFFICE‑EMPLOYEE set relationships use the Automatic connect option, you must supply the Office Code and Department ID when you add a row to the EMPLOYEE table. The INSERT statement to add a row to the STRUCTURE table would be very similar. Any foreign key that represents an Automatic set relationship (Aux or Path) is required and must be complete before the row can be inserted.