Load data into a table using SQL

A simple method of loading data into a table is to use an SQL application and the SQL INSERT operation.

Consider a situation in which a Spiffy regional center needs to add inventory items to a dealership's inventory table on a periodic basis as regular inventory shipments are made from the regional center to the dealership.

INSERT INTO SPIFFY.INVENT
   (PART, DESC, QTY, PRICE)
 VALUES
  ('1234567', 'LUG NUT', 25, 1.15 )

The preceding statement inserts one row of data into a table called INVENT in an SQL collection named SPIFFY.

For each item on the regular shipment, an SQL INSERT statement places a row in the inventory table for the dealership. In the preceding example, if 15 different items were shipped to the dealership, the application at the regional office could include 15 SQL INSERT statements or a single SQL INSERT statement using host variables.

In this example, the regional center is using an SQL application to load data into a table at an application server (AS). Runtime support for SQL is provided in the i5/OS™ licensed program, so the AS does not need the IBM® DB2® Query Manager and SQL Development Kit for iSeries™ licensed program. However, the IBM DB2 Query Manager and SQL Development Kit for iSeries licensed program is required to write the application.

Related concepts
SQL programming
Related reference
SQL reference