Appendix E. Stored procedures and scripts 263
IN_TAX, IN_CUSTKEY, IN_PARTKEY, IN_SUPPKEY,
IN_ORDERKEY, IN_TIMEKEY);
SET insertcount = insertcount + 1;
END;
-- if the operation is not an I, then it is an error
-- we are not doing anything special with error conditions
-- for this test
ELSE
SET errorcount = errorcount + 1;
END CASE;
SET processedcount = processedcount + 1;
-- check to see if we should issue a commit based on the input
-- parameter, commitCount, before we go to the top of the while
-- loop
IF processedcount >= commitCount THEN
COMMIT;
SET processedcount = 0;
END IF;
-- Get next message
FETCH cursor1 INTO IN_OPERATION, IN_QUANTITY, IN_DISCOUNT,
IN_EXTENDEDPRICE, IN_TAX, IN_CUSTKEY,
IN_PARTKEY, IN_SUPPKEY, IN_ORDERKEY,
IN_TIMEKEY;
END WHILE;
COMMIT;
SET msg_TMP = 'INSERTS: ' concat CHAR(insertcount) concat ' UPDATES: '
concat CHAR(updatecount) concat 'ERRORS: '
concat CHAR(errorcount);
CLOSE cursor1;
SET msg = msg_TMP;
END P1
E.6 Scenario 4: DB2 online load utility
In this scenario we use the scripts described in E.2, “General scripts” on
page 238. We create one additional script called FACTLOAD to start the load
process. The contents of this script changes depending on the load source. We
depict these scripts in Example E-36 to Example E-38. The view

Get Preparing for DB2 Near-Realtime Business Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.