-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_registration_table.sql
92 lines (77 loc) · 4.07 KB
/
create_registration_table.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
To be run as CMS_MTD_CORE_COND
*/
INSERT INTO CMS_MTD_CORE_COND.KINDS_OF_CONDITIONS (NAME, IS_RECORD_DELETED, EXTENSION_TABLE_NAME, COMMENT_DESCRIPTION) VALUES ('XTALREGISTRATION', 'F', 'XTALREGISTRATION', 'Crystal registration and visual inspection');
/*
To be run as CMS_MTD_TMING_COND
*/
DROP TABLE CMS_MTD_TMING_COND.XTALREGISTRATION CASCADE CONSTRAINTS;
CREATE TABLE CMS_MTD_TMING_COND.XTALREGISTRATION
(
RECORD_ID NUMBER(38) NOT NULL,
CONDITION_DATA_SET_ID NUMBER(38) NOT NULL,
BATCH_INGOT_DATA VARCHAR(40),
OPERATORCOMMENT VARCHAR(255)
)
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 10M
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE;
CREATE UNIQUE INDEX CMS_MTD_TMING_COND.XTLRGSTRTN_PK ON CMS_MTD_TMING_COND.XTALREGISTRATION (RECORD_ID);
ALTER TABLE CMS_MTD_TMING_COND.XTALREGISTRATION ADD (
CONSTRAINT XTLRGSTRTN_PK
PRIMARY KEY
(RECORD_ID)
USING INDEX CMS_MTD_TMING_COND.XTLRGSTRTN_PK
ENABLE VALIDATE);
CREATE INDEX CMS_MTD_TMING_COND.XTLRGSTRTN_FK_I ON CMS_MTD_TMING_COND.XTALREGISTRATION (CONDITION_DATA_SET_ID);
ALTER TABLE CMS_MTD_TMING_COND.XTALREGISTRATION ADD (
CONSTRAINT XTLRGSTRTN_FK
FOREIGN KEY (CONDITION_DATA_SET_ID)
REFERENCES CMS_MTD_CORE_COND.COND_DATA_SETS (CONDITION_DATA_SET_ID)
ENABLE VALIDATE);
GRANT SELECT ON CMS_MTD_TMING_COND.XTALREGISTRATION TO CMS_MTD_TMING_CONDITION_READER;
GRANT SELECT ON CMS_MTD_TMING_COND.XTALREGISTRATION TO PUBLIC;
GRANT INSERT ON CMS_MTD_TMING_COND.XTALREGISTRATION TO CMS_MTD_CORE_CONDITION_WRITER;
GRANT UPDATE ON CMS_MTD_TMING_COND.XTALREGISTRATION TO CMS_MTD_CORE_CONDITION_WRITER;
GRANT INSERT ON CMS_MTD_TMING_COND.XTALREGISTRATION TO CMS_MTD_PRTYP_TMING_WRT;
GRANT UPDATE ON CMS_MTD_TMING_COND.XTALREGISTRATION TO CMS_MTD_PRTYP_TMING_WRT;
INSERT INTO CMS_MTD_CORE_COND.COND_TO_PART_RLTNSHPS
(KIND_OF_PART_ID, KIND_OF_CONDITION_ID, DISPLAY_NAME, IS_RECORD_DELETED)
VALUES ((SELECT KIND_OF_PART_ID FROM CMS_MTD_CORE_CONSTRUCT.KINDS_OF_PARTS WHERE
DISPLAY_NAME = 'LYSOMatrix #1' AND IS_RECORD_DELETED = 'F'),
(SELECT KIND_OF_CONDITION_ID FROM
CMS_MTD_CORE_COND.KINDS_OF_CONDITIONS WHERE EXTENSION_TABLE_NAME = 'XTALREGISTRATION' AND
NAME = 'XTALREGISTRATION'), 'Crystal registration and visual inspection for LYSOMAtrix #1', 'F');
INSERT INTO CMS_MTD_CORE_COND.COND_TO_PART_RLTNSHPS
(KIND_OF_PART_ID, KIND_OF_CONDITION_ID, DISPLAY_NAME, IS_RECORD_DELETED)
VALUES ((SELECT KIND_OF_PART_ID FROM CMS_MTD_CORE_CONSTRUCT.KINDS_OF_PARTS WHERE
DISPLAY_NAME = 'LYSOMatrix #2' AND IS_RECORD_DELETED = 'F'),
(SELECT KIND_OF_CONDITION_ID FROM
CMS_MTD_CORE_COND.KINDS_OF_CONDITIONS WHERE EXTENSION_TABLE_NAME = 'XTALREGISTRATION' AND
NAME = 'XTALREGISTRATION'), 'Crystal registration and visual inspection for LYSOMatrix #2', 'F');
INSERT INTO CMS_MTD_CORE_COND.COND_TO_PART_RLTNSHPS
(KIND_OF_PART_ID, KIND_OF_CONDITION_ID, DISPLAY_NAME, IS_RECORD_DELETED)
VALUES ((SELECT KIND_OF_PART_ID FROM CMS_MTD_CORE_CONSTRUCT.KINDS_OF_PARTS WHERE
DISPLAY_NAME = 'LYSOMatrix #3' AND IS_RECORD_DELETED = 'F'),
(SELECT KIND_OF_CONDITION_ID FROM
CMS_MTD_CORE_COND.KINDS_OF_CONDITIONS WHERE EXTENSION_TABLE_NAME = 'XTALREGISTRATION' AND
NAME = 'XTALREGISTRATION'), 'Crystal registration and visual inspection for LYSOMatrix #3', 'F');
INSERT INTO CMS_MTD_CORE_COND.COND_TO_PART_RLTNSHPS
(KIND_OF_PART_ID, KIND_OF_CONDITION_ID, DISPLAY_NAME, IS_RECORD_DELETED)
VALUES ((SELECT KIND_OF_PART_ID FROM CMS_MTD_CORE_CONSTRUCT.KINDS_OF_PARTS WHERE
DISPLAY_NAME = 'singleBarCrystal' AND IS_RECORD_DELETED = 'F'),
(SELECT KIND_OF_CONDITION_ID FROM
CMS_MTD_CORE_COND.KINDS_OF_CONDITIONS WHERE EXTENSION_TABLE_NAME = 'XTALREGISTRATION' AND
NAME = 'XTALREGISTRATION'), 'Crystal registration and visual inspection for singleBarCrystal', 'F');