SQL/MX Quick Start (G06.24+, H06.03+)

HP NonStop SQL/MX Quick Start523724-002
6-1
6
Changing Information in a Table
This section provides information about how to insert, update, and delete table rows.
Inserting a Row Into a Table
To insert rows in a table, use the INSERT statement.
Example
In the PARTS table, insert a row that describes a data modem with part number 9999:
INSERT INTO PARTS (PARTNUM, PARTDESC, PRICE)
VALUES (9999, 'DATA MODEM', 200.00);
--- 1 row(s) inserted.
Tip
The definition of the PARTS table specifies a default value of zero for the
QTY_AVAILABLE column. If you do not know the quantity available when you insert
the row, you do not have to provide a value for that column. SQL/MX provides a value
of zero.
Example
Insert another row into PARTS. This time supply the quantity available:
INSERT INTO PARTS
VALUES (9998, '300 BD DATA MODEM', 120.00, 3);
--- 1 row(s) inserted.
Tip
Because you are supplying a value for each column, you can omit the list of column
names. In this form of the INSERT statement, you must specify the values in the order
in which a SELECT * statement or an INVOKE command would display them.