Inserting information into a table

 

After you create a table and define its columns, you can insert data into your table. To add data to the INVENTORY_LIST table, follow these steps:

  1. From iSeries™ Navigator, expand the system that you want to use.

  2. Expand Databases and the database that you want to work with.

  3. Expand Schemas.

  4. Select SAMPLELIB.

  5. Double-click Tables.

  6. Right-click INVENTORY_LIST and select Edit Contents.

  7. From the Rows menu, select Insert. A new row is shown.

  8. Type the information in the following table under the appropriate headings.

    The values that you insert must satisfy all constraints and satisfy the type of each column. If there is a unique constraint or an index over the table, the values that you insert must be unique key values. If you do not insert a value in a column, the default value is used, if allowed. For this example, insert only those values shown in the following table so that the default values are used.

    ITEM_NUMBER ITEM_NAME UNIT_COST QUANTITY_ON_HAND
    153047 Pencils, red 10.00 25
    229740 Lined tablets 1.50 120
    544931   5.00  
    303476 Paper clips 2.00 100
    559343 Envelopes, legal 3.00 500
    291124 Envelopes, standard    
    775298 Chairs, secretary 225.00 6
    073956 Pens, black 20.00 25

  9. From the File menu, select Save.

  10. Add the following rows to the SAMPLELIB.SUPPLIERS table.

    ITEM_NUMBER SUPPLIER_NUMBER SUPPLIER_COST
    153047 1234 10.00
    229740 1234 1.00
    303476 1234 3.00
    153047 9988 8.00
    559343 9988 3.00
    153047 2424 9.00
    303476 2424 2.50
    775298 5546 225.00
    303476 3366 1.50
    073956 3366 17.00

  11. From the File menu, select Save. The example schema now contains two tables with rows of data in each table.

 

Parent topic:

Creating a table and defining a column