Resulting Tables

The examples in this section assume that the Microsoft SQL Server database is being used and that the Client uses the SET MAINSET as the source for index for the various tables.

The following tables are derived from the variable-format data set MAIN:

  • main (type 0 records)
  • main_type1 (type 1 records)
  • main_type2 (type 2 records)
  • main_type3 (type 3 records)

    Note: All four tables contain the fixed part of the data set. The var_rec column is the record type; all records in the individual tables will have the same value in this field.

Record Type 0 Table

The table named main represents all type 0 records that do not have a variable part. The var_rec column of all records in this table will have a value of 0. Note that this table may be empty if your application does not use type 0 records. The SQL statement to create this table is shown as follows:

create table main
(
cust_no int,
var_rec smallint,
cpu char(6)
)

Record Type 1 Table

The table named main_type1 represents all type 1 records. The var_rec column of all records in this table will have a value of 1. The SQL statement to create this table is shown as follows:

create table main_type1
(
cust_no int,
var_rec smallint,
cpu char(6),
smsa char(4),
sales char(6)
)

Record Type 2 Table

The table named main_type2 represents all type 2 records. The var_rec column of all records in this table will have a value of 2. The SQL statement to create this table is shown as follows:

create table main_type1
(
cust_no int,
var_rec smallint,
cpu char(6),
status char(1),
received char(6),
order_date int
)

Record Type 3 Table

The table named main_type3 represents all type 3 records. The var_rec column of all records in this table will have a value of 3. The SQL statement to create this table is shown as follows:

create table main_type1
(
cust_no int,
var_rec smallint,
cpu char(6),
site char(7),
source char(7),
class char(2)
)