-- E. Gallas  Aug 2005
--
-- Create the LBN_TRIGGERS table (extracted from the ddl lum_cdsddl.tab).
-- Modify to change the type of PRESCALE column from NUMBER to VARCHAR2(64)
----------------------------------------------------------------------------

PROMPT Creating Table 'LBN_TRIGGERS'
CREATE TABLE LBN_TRIGGERS
 (LT_ID NUMBER(38) NOT NULL
 ,LBN NUMBER(38,0) NOT NULL
 ,L3_BIT_NAME VARCHAR2(100) NOT NULL
 ,EG_NUM NUMBER(2,0) DEFAULT 8 NOT NULL
 ,DECORR_SCALER NUMBER NOT NULL
 ,L1_ACCEPTS NUMBER NOT NULL
 ,L2_ACCEPTS NUMBER NOT NULL
 ,REC_ACCEPTS NUMBER NOT NULL
 ,PRESCALE            VARCHAR2(64)                NOT NULL
 ,RUN_NUMBER NUMBER(38,0)
 ,L1_LUM_NIM NUMBER
 ,REC_LUM_NIM NUMBER
 ,L1_LUM_VME NUMBER
 ,REC_LUM_VME NUMBER
 )
 PCTFREE 10
 STORAGE
 (
   INITIAL 78M
   NEXT 78M
   PCTINCREASE 0
   MINEXTENTS 1
   MAXEXTENTS 100
 ) TABLESPACE LUM_DATA
/

COMMENT ON COLUMN LBN_TRIGGERS.LT_ID IS 'Primary Key for the table Sequence Generated . Populated by trigger'
/

COMMENT ON COLUMN LBN_TRIGGERS.L3_BIT_NAME IS 'trigger name'
/

COMMENT ON COLUMN LBN_TRIGGERS.EG_NUM IS 'exposure group'
/

COMMENT ON COLUMN LBN_TRIGGERS.L1_ACCEPTS IS 'number of L1 Accepts during this LBN for this trigger'
/

COMMENT ON COLUMN LBN_TRIGGERS.L2_ACCEPTS IS 'number of L2 accepts during this LBN for this trigger'
/

COMMENT ON COLUMN LBN_TRIGGERS.REC_ACCEPTS IS 'number of recorded accepts during this LBN for this trigger'
/

COMMENT ON COLUMN LBN_TRIGGERS.PRESCALE IS 'Level 1 prescale applied'
/

COMMENT ON COLUMN LBN_TRIGGERS.RUN_NUMBER IS 'Run Number used in online data taking'
/

COMMENT ON COLUMN LBN_TRIGGERS.L1_LUM_NIM IS 'Level 1 Luminosity measured by Run 1 NIM electronics'
/

COMMENT ON COLUMN LBN_TRIGGERS.REC_LUM_NIM IS 'Recorded Luminosity measured by Run 1 NIM electronics'
/

COMMENT ON COLUMN LBN_TRIGGERS.L1_LUM_VME IS 'Level 1 Luminosity measured by Run 2 VME electronics'
/

COMMENT ON COLUMN LBN_TRIGGERS.REC_LUM_VME IS 'Recorded Luminosity measured by Run 2 VME electronics'
/

