Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
[Figure: Using a query specification to add data (where the column layout is the same)]
In Example 1, the layout of the columns in the table to which data is added and the table from which data is fetched
have a one-to-one correspondence. Usually, the layout of columns in tables does not correspond so closely. For
example, the data from some columns in a table may be added to another table. Or, a value determined beforehand
by an application program may be added to a column in the table to which data is to be added. An example of this
follows.
Suppose a table named CASSETTE table containing STOCKQTY and ORDERQTY data for CASSETTE DECK and
CASSETTE TAPE. This table consists of four columns: ITMNO, TYPE, QUANTITY, and PART. CASSETTE DECK is
set as "D" and CASSETTE TAPE as "T" in column TYPE. The quantity of stock and orders is set in column QUANTITY.
In column PART, stock is "1", orders placed with CUSTOMER is "2", and orders placed with multiple CUSTOMER is
"3".
Example 2:
In this example, ITMNO and STOCKQTY from the STOCK table are added to the CASSETTE table.
Also, "D", which stands for CASSETTE DECK, is set in column TYPE, and "1", which stands for stock,
is set in host variable PART.
26