-- TD 12107 Additional columns and views for BI 

INSERT INTO DWH_SETTINGSPERTABLE
           (TABLENAME, ISFACTYN, LOADYN, SYSTEMUSER_ID, TIMESTAMP, SOURCESYSTEM)
  SELECT 'WEARER_EMPLOYMENT', 'N', 'N', 1, SYSDATE, 0
    FROM DUAL
   WHERE NOT EXISTS (SELECT 1
                       FROM DWH_SETTINGSPERTABLE h
                      WHERE H.TABLENAME = 'WEARER_EMPLOYMENT');




INSERT INTO DWH_SETTINGSPERTABLE
           (TABLENAME, ISFACTYN, LOADYN, SYSTEMUSER_ID, TIMESTAMP, SOURCESYSTEM)
  SELECT 'WEARER_INVENTORY', 'Y', 'N', 1, sysdate, 0
    FROM dual
   WHERE NOT EXISTS (SELECT 1
                       FROM DWH_SETTINGSPERTABLE h
                      WHERE H.TABLENAME = 'WEARER_INVENTORY');
COMMIT;



INSERT INTO DWH_STRING (DWH_STRING_ID, FACTORYDESCRIPTION, MAXSTRINGLENGTH, DIMENSION_TABLE, DIMENSION_COLUMN, SYSTEMUSER_ID, TIMESTAMP)
 SELECT 640, 'Male', 15, 'Wearer Employment', 'Gender', 1, SYSDATE
    FROM DUAL
   WHERE NOT EXISTS (SELECT 1
                       FROM DWH_STRING h
                      WHERE H.DWH_STRING_ID = 640);




INSERT INTO DWH_STRING (DWH_STRING_ID, FACTORYDESCRIPTION, MAXSTRINGLENGTH, DIMENSION_TABLE, DIMENSION_COLUMN, SYSTEMUSER_ID, TIMESTAMP)
 SELECT 641, 'Female', 15, 'Wearer Employment', 'Gender', 1, SYSDATE
    FROM DUAL
   WHERE NOT EXISTS (SELECT 1
                       FROM DWH_STRING h
                      WHERE H.DWH_STRING_ID = 641);
COMMIT;
