--------------------------------------------------------
--  File created - Wednesday-September-30-2015   
--------------------------------------------------------
--------------------------------------------------------
--  DDL for Table LU_MAD_VDATUM
--------------------------------------------------------

  CREATE TABLE "STORETW"."LU_MAD_VDATUM" 
   (	"PK_ISN" NUMBER(12,0), 
	"ID_CODE" VARCHAR2(12 CHAR), 
	"ELEVATION_DATUM" VARCHAR2(254 CHAR)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 90 INITRANS 1 MAXTRANS 255 
 COMPRESS FOR OLTP NOLOGGING
  STORAGE(INITIAL 10485760 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STORETDATA_STORMODP" 
   CACHE ;

   COMMENT ON COLUMN "STORETW"."LU_MAD_VDATUM"."PK_ISN" IS 'Primary Key. Generated using sequence object SEQ_MAD_VDATUM.';
   COMMENT ON COLUMN "STORETW"."LU_MAD_VDATUM"."ID_CODE" IS 'A cryptic ID code assigned through EPA Locational Data Policy to represent the Method or Datum referenced.';
   COMMENT ON COLUMN "STORETW"."LU_MAD_VDATUM"."ELEVATION_DATUM" IS 'A permanently established horizontal plane, surface, or level to which soundings, ground elevations, depths, water surface elevations, and tidal data are referred.';
   COMMENT ON TABLE "STORETW"."LU_MAD_VDATUM"  IS 'Vertical Datum lookup table';
REM INSERTING into STORETW.LU_MAD_VDATUM
SET DEFINE OFF;
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (1,'LTD','Local Tidal Datum');
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (2,'NAVD88','North American Vertical Datum of 1988');
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (3,'NGVD29','National Geodetic Vertical Datum of 1929');
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (4,'OTHER','Other');
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (5,'SEALV','Elevation From Mean Sea-Level');
Insert into STORETW.LU_MAD_VDATUM (PK_ISN,ID_CODE,ELEVATION_DATUM) values (6,'UNKWN','Unknown');
--------------------------------------------------------
--  DDL for Index DB_VDATUM01
--------------------------------------------------------

  CREATE UNIQUE INDEX "STORETW"."DB_VDATUM01" ON "STORETW"."LU_MAD_VDATUM" ("ID_CODE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STORETINDX_STORMODP" ;
--------------------------------------------------------
--  DDL for Index PK_MAD_VDATUM
--------------------------------------------------------

  CREATE UNIQUE INDEX "STORETW"."PK_MAD_VDATUM" ON "STORETW"."LU_MAD_VDATUM" ("PK_ISN") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STORETDATA_STORMODP" ;
--------------------------------------------------------
--  Constraints for Table LU_MAD_VDATUM
--------------------------------------------------------

  ALTER TABLE "STORETW"."LU_MAD_VDATUM" ADD CONSTRAINT "PK_MAD_VDATUM" PRIMARY KEY ("PK_ISN")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "STORETDATA_STORMODP"  ENABLE;
  ALTER TABLE "STORETW"."LU_MAD_VDATUM" MODIFY ("ID_CODE" NOT NULL ENABLE);
