-- Generated for Oracle 8 on Wed May 27  13:45:12 1998 by Server Generator 2.1.20.0.0
  
PROMPT Creating Primary Key on 'CK_REPORT_PARAMETER_USAGES'
--RAU CK_RPT_PU_PK
ALTER TABLE CK_REPORT_PARAMETER_USAGES
 ADD CONSTRAINT CK_RPT_PU_PK PRIMARY KEY 
  (RPU_PARAM_ID
  ,RPU_RPT_ID)
/

-- B1657085, B2506117 : patch M92\stlyon_005
PROMPT Creating Primary Key on 'CK_REPORT_FOLDERS'
--RAU CK_RPT_FOLDERS_PK
ALTER TABLE CK_REPORT_FOLDERS 
 ADD CONSTRAINT CK_RPT_FOLDERS_PK PRIMARY KEY
  (IRID)
/

PROMPT Creating Primary Key on 'CK_NLS_REPORT_GROUPS'
--RAU CK_NLS_REPORT_GROUPS_PK
ALTER TABLE CK_NLS_REPORT_GROUPS
 ADD CONSTRAINT CK_NLS_REPORT_GROUPS_PK PRIMARY KEY 
  (NLS_LANGUAGE
  ,RPG_ID)
/

PROMPT Creating Primary Key on 'CK_NLS_REPORTS'
--RAU CK_NLS_REPORTS_PK
ALTER TABLE CK_NLS_REPORTS
 ADD CONSTRAINT CK_NLS_REPORTS_PK PRIMARY KEY 
  (NLS_LANGUAGE
  ,RPT_ID)
/

PROMPT Creating Primary Key on 'CK_REPORT_GROUP_USAGES'
--RAU CK_RPT_RGU_PK1
ALTER TABLE CK_REPORT_GROUP_USAGES
 ADD CONSTRAINT CK_RPT_RGU_PK1 PRIMARY KEY 
  (RGU_RPG_ID
  ,RGU_RPT_ID)
/

PROMPT Creating Primary Key on 'CK_TEMPORARY_SET'
--RAU CK_TEMPORARY_SET_PK
ALTER TABLE CK_TEMPORARY_SET
 ADD CONSTRAINT CK_TEMPORARY_SET_PK PRIMARY KEY 
  (ID
  ,TRANS_REF)
/

PROMPT Creating Primary Key on 'CK_REPORT_GROUPS'
--RAU CK_REPORT_GROUPS_PK
ALTER TABLE CK_REPORT_GROUPS
 ADD CONSTRAINT CK_REPORT_GROUPS_PK PRIMARY KEY 
  (RPG_ID)
/

PROMPT Creating Primary Key on 'CK_REPORTS'
--RAU CK_REPORTS_PK
ALTER TABLE CK_REPORTS
 ADD CONSTRAINT CK_REPORTS_PK PRIMARY KEY 
  (RPT_ID)
/

PROMPT Creating Primary Key on 'CK_REPORT_PARAMETERS'
--RAU CK_REPORT_PARAMETERS_PK
ALTER TABLE CK_REPORT_PARAMETERS
 ADD CONSTRAINT CK_REPORT_PARAMETERS_PK PRIMARY KEY 
  (PARAM_ID)
/

PROMPT Creating Primary Key on 'CK_NLS_PARAMETERS'
--RAU CK_NLS_PARAMETERS_PK
ALTER TABLE CK_NLS_PARAMETERS
 ADD CONSTRAINT CK_NLS_PARAMETERS_PK PRIMARY KEY 
  (NLS_LANGUAGE
  ,PARAM_ID)
/

PROMPT Creating Unique Keys on 'CK_REPORT_PARAMETER_USAGES'
--RAU CK_RPT_PU_U1
ALTER TABLE CK_REPORT_PARAMETER_USAGES 
 ADD CONSTRAINT CK_RPT_PU_U1 UNIQUE 
  (RPU_RPT_ID
  ,RPU_PARAM_ID)
/

PROMPT Creating Unique Keys on 'CK_NLS_REPORT_GROUPS'
--RAU CK_NLS_REPORT_GROUPS_U2
ALTER TABLE CK_NLS_REPORT_GROUPS 
 ADD CONSTRAINT CK_NLS_REPORT_GROUPS_U2 UNIQUE 
  (NLS_LANGUAGE
  ,RPG_ID
  ,RPG_NAME) 
/

PROMPT Creating Unique Keys on 'CK_NLS_REPORT_GROUPS'
--RAU CK_NLS_REPORT_GROUPS_U1
ALTER TABLE CK_NLS_REPORT_GROUPS 
 ADD CONSTRAINT CK_NLS_REPORT_GROUPS_U1 UNIQUE 
  (RPG_ID
  ,NLS_LANGUAGE)
/

PROMPT Creating Unique Keys on 'CK_NLS_REPORTS'
--RAU CK_NLS_REPORTS_U1
ALTER TABLE CK_NLS_REPORTS 
 ADD CONSTRAINT CK_NLS_REPORTS_U1 UNIQUE 
  (RPT_ID
  ,NLS_LANGUAGE) 
/

PROMPT Creating Unique Keys on 'CK_NLS_REPORTS'
--RAU CK_NLS_REPORTS_U2
ALTER TABLE CK_NLS_REPORTS 
 ADD CONSTRAINT CK_NLS_REPORTS_U2 UNIQUE 
  (NLS_LANGUAGE
  ,RPT_ID
  ,RPT_NAME
  ,RPT_TITLE)
/

PROMPT Creating Unique Keys on 'CK_REPORT_GROUP_USAGES'
--RAU CK_RPT_RGU_U1
ALTER TABLE CK_REPORT_GROUP_USAGES 
 ADD CONSTRAINT CK_RPT_RGU_U1 UNIQUE 
  (RGU_RPT_ID
  ,RGU_RPG_ID)
/

PROMPT Creating Unique Keys on 'CK_REPORT_PARAMETERS'
--RAU CK_REPORT_PARAMETERS_U1
ALTER TABLE CK_REPORT_PARAMETERS 
 ADD CONSTRAINT CK_REPORT_PARAMETERS_U1 UNIQUE 
  (PARAM_ID
  ,PARAM_NAME)
/

PROMPT Creating Unique Keys on 'CK_NLS_PARAMETERS'
--RAU CK_NLS_PARAMETERS_U1
ALTER TABLE CK_NLS_PARAMETERS 
 ADD CONSTRAINT CK_NLS_PARAMETERS_U1 UNIQUE 
  (PARAM_ID
  ,NLS_LANGUAGE)
/
                   
PROMPT Creating Check Constraints on 'CK_TEMPORARY_SET'
--RAU CK_TEMPORARY_SET_C1
ALTER TABLE CK_TEMPORARY_SET
 ADD CONSTRAINT CK_TEMPORARY_SET_C1 CHECK (el_str in ('E','S'))
/

PROMPT Creating Check Constraints on 'CK_TEMPORARY_SET'
--RAU CK_TEMPORARY_SET_C3
ALTER TABLE CK_TEMPORARY_SET
 ADD CONSTRAINT CK_TEMPORARY_SET_C3 CHECK (read_only in ('S','K','R') or read_only is NULL)
/

PROMPT Creating Check Constraints on 'CK_TEMPORARY_SET'
--RAU CK_TEMPORARY_SET_C2 
ALTER TABLE CK_TEMPORARY_SET
 ADD CONSTRAINT CK_TEMPORARY_SET_C2 CHECK (marked = 'Y' or marked is null)
/
                              
PROMPT Creating Foreign Keys on 'CK_REPORT_PARAMETER_USAGES'
--RAU CK_RPT_PU_FK1
ALTER TABLE CK_REPORT_PARAMETER_USAGES ADD CONSTRAINT
 CK_RPT_PU_FK1 FOREIGN KEY 
  (RPU_RPT_ID) REFERENCES CK_REPORTS
  (RPT_ID) ON DELETE CASCADE 
/      
                                   
PROMPT Creating Foreign Keys on 'CK_REPORT_PARAMETER_USAGES'
--RAU CK_RPT_PU_FK2 
ALTER TABLE CK_REPORT_PARAMETER_USAGES ADD CONSTRAINT
 CK_RPT_PU_FK2 FOREIGN KEY 
  (RPU_PARAM_ID) REFERENCES CK_REPORT_PARAMETERS
  (PARAM_ID) ON DELETE CASCADE
/

PROMPT Creating Foreign Keys on 'CK_NLS_REPORT_GROUPS'
--RAU CK_NLS_REPORT_GROUPS_FK1 
ALTER TABLE CK_NLS_REPORT_GROUPS ADD CONSTRAINT
 CK_NLS_REPORT_GROUPS_FK1 FOREIGN KEY 
  (RPG_ID) REFERENCES CK_REPORT_GROUPS
  (RPG_ID) ON DELETE CASCADE
/

PROMPT Creating Foreign Keys on 'CK_NLS_REPORTS'
--RAU CK_NLS_REPORTS_FK1 
ALTER TABLE CK_NLS_REPORTS ADD CONSTRAINT
 CK_NLS_REPORTS_FK1 FOREIGN KEY 
  (RPT_ID) REFERENCES CK_REPORTS
  (RPT_ID) ON DELETE CASCADE
/

PROMPT Creating Foreign Keys on 'CK_REPORT_GROUP_USAGES'
--RAU CK_RPT_GU_FK1 
ALTER TABLE CK_REPORT_GROUP_USAGES ADD CONSTRAINT
 CK_RPT_GU_FK1 FOREIGN KEY 
  (RGU_RPT_ID) REFERENCES CK_REPORTS
  (RPT_ID) ON DELETE CASCADE 
/

PROMPT Creating Foreign Keys on 'CK_REPORT_GROUP_USAGES'
--RAU CK_RPT_GU_FK2 
ALTER TABLE CK_REPORT_GROUP_USAGES ADD CONSTRAINT
 CK_RPT_GU_FK2 FOREIGN KEY 
  (RGU_RPG_ID) REFERENCES CK_REPORT_GROUPS
  (RPG_ID) ON DELETE CASCADE
/

PROMPT Creating Foreign Keys on 'CK_NLS_PARAMETERS'
--RAU CK_NLS_PARAMS_FK1  
ALTER TABLE CK_NLS_PARAMETERS ADD CONSTRAINT
 CK_NLS_PARAMS_FK1 FOREIGN KEY 
  (PARAM_ID) REFERENCES CK_REPORT_PARAMETERS
  (PARAM_ID) ON DELETE CASCADE
/

exit


