# Shell script to create and load the CAP tables for a user into a # DB2 UDB database running on a UNIX system. # Note that db2 needs at least "x" permission to the current directory # and its higher directories for the loads. # Usage: loadcap db2 << MARK connect to $1 drop table customers --the following creates are in Entry SQL-92, i.e., should work on most systems create table customers (cid char(4) not null, cname varchar(13), city varchar(20), discnt real, primary key (cid)) drop table agents create table agents (aid char(3) not null, aname varchar(13), city varchar(20), percent smallint, primary key (aid)) drop table products create table products (pid char(3) not null, pname varchar(13), city varchar(20), quantity integer, price double precision, primary key (pid)) drop table orders create table orders (ordno integer not null, month char(3), cid char(4), aid char(3), pid char(3), qty integer, dollars double precision, primary key (ordno)) load from custs.dat of del insert into customers load from agents.dat of del insert into agents load from prods.dat of del insert into products load from orders.dat of del insert into orders MARK