
/* Code Fragment 9.19 Define the state table as a view. */

CREATE VIEW P_TT_VIEW
	(PROJECTION_ID, PROJECTION_NAME, PROJECTION_TYPE, SPHEROID_CODE,
	 PROJECTION_UOM, ZONE_CODE, Start_Date, Stop_Date)
AS
SELECT * FROM P_TT_PAST
UNION
SELECT	PROJECTION_ID, PROJECTION_NAME, PROJECTION_TYPE, SPHEROID_CODE,
	PROJECTION_UOM, ZONE_CODE, Start_Date, GETDATE() AS Stop_Date
FROM P_TT_CURRENT
