Product Documentation

FairCom ISQL

Previous Topic

Next Topic

Manage

Manage() provides data management functionality for your application and/or process.

Below is the code for Manage():

-- Manage

ECHO MANAGE;

ECHO Delete records...;

DELETE FROM custmast;

DELETE FROM custordr;

DELETE FROM ordritem;

DELETE FROM itemmast;

ECHO Add records...;

INSERT INTO custmast VALUES ('1000', '92867', 'CA', '1', 'Bryan Williams', '2999 Regency', 'Orange');

INSERT INTO custmast VALUES ('1001', '61434', 'CT', '1', 'Michael Jordan', '13 Main', 'Harford');

INSERT INTO custmast VALUES ('1002', '73677', 'GA', '1', 'Joshua Brown', '4356 Cambridge', 'Atlanta');

INSERT INTO custmast VALUES ('1003', '10034', 'MO', '1', 'Keyon Dooling', '19771 Park Avenue', 'Columbia');

INSERT INTO custordr VALUES ('09/01/2002', '09/05/2002', '1', '1001');

INSERT INTO custordr VALUES ('09/02/2002', '09/06/2002', '2', '1002');

INSERT INTO ordritem VALUES (1, 2, '1', '1');

INSERT INTO ordritem VALUES (2, 1, '1', '2');

INSERT INTO ordritem VALUES (3, 1, '1', '3');

INSERT INTO ordritem VALUES (1, 3, '2', '3');

INSERT INTO itemmast VALUES (10, 19.95, '1', 'Hammer');

INSERT INTO itemmast VALUES (3, 9.99, '2', 'Wrench');

INSERT INTO itemmast VALUES (4, 16.59, '3', 'Saw');

INSERT INTO itemmast VALUES (1, 3.98, '4', 'Pliers');

ECHO;

ECHO Query results;

SELECT cm_custname "Name", SUM(im_itempric * oi_quantity) "Total"

FROM custmast, custordr, ordritem, itemmast

WHERE co_custnumb = cm_custnumb AND co_ordrnumb = oi_ordrnumb AND oi_itemnumb = im_itemnumb

GROUP BY cm_custnumb, cm_custname;

TOCIndex