I second this as long as you can handle the refresh requirement. We
have some MQTs that are refreshed only on demand when a specific job is run.
If you can get by with periodic refresh (daily/hourly)
then a MQT (Materialized Query Table) might by what you're looking for.
unfortunately DB2/400 does not support REFRESH IMMEDIATE
so you have to refresh it yourself.
This certainly worked for me.
date: Thu, 30 Jan 2014 17:58:43 -0500
from: Hoteltravelfundotcom <hoteltravelfun@xxxxxxxxx>
subject: Re: how to make a key on a view?
the source for the DTAWHS is this
CREATE TABLE PROJ_MKWN1/DTAWHS (
CUSTOMER# CHAR ( 8),
NAME CHAR (40 ),
CITY CHAR (30 ),
STATE CHAR (3 ),
COUNTRY CHAR (3 ),
ZIP_CODE char (10 ),
ITEM# CHAR (15 ),
ITEM_TEXT CHAR (40 ),
ORDER# CHAR (8 ),
ORD_STATUS CHAR (2 ),
INVOICE# CHAR (8 ),
ORD_DATE NUMERIC (8 , 0),
INV_DATE numeric (8 , 0),
ORD_TYPE CHAR (3 ),
CUST_TYPE CHAR (3 ),
PROD_LINE CHAR (3 ),
SALES_REP CHAR (3 ),
WAREHOUSE CHAR (3 ),