периферия:
Цитата: CREATE TABLE SADOCDEFAULTS
(
DOCTYPE CHAR(2 BYTE) NOT NULL,
LOCATION NUMBER(10) NOT NULL,
NAMEPREFIX VARCHAR2(10 BYTE),
NAMEOUTPREFIX VARCHAR2(10 BYTE),
NUMBERSIZE NUMBER(5) NOT NULL,
PRICEKIND NUMBER(5)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
CREATE UNIQUE INDEX SACDOCDEFAULTS_PK ON SADOCDEFAULTS
(DOCTYPE, LOCATION)
TABLESPACE INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFNUMBERSIZE
CHECK (NumberSize between 1 and (50 - 10)));
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFAULTS_PK
PRIMARY KEY
(DOCTYPE, LOCATION)
USING INDEX
TABLESPACE INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFLOCATION
FOREIGN KEY (LOCATION)
REFERENCES
ON DELETE CASCADE);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFPRICESTYPE
FOREIGN KEY (PRICEKIND)
REFERENCES);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFDOCTYPE
FOREIGN KEY (DOCTYPE)
REFERENCES);
GRANT SELECT ON SADOCDEFAULTS TO SUPERMAG_USER;
GRANT DELETE, INSERT, SELECT, UPDATE ON SADOCDEFAULTS TO SUPERMAG_FN_EDITDOCDEFAULTS;
GRANT INSERT ON SADOCDEFAULTS TO SUPERMAG_FN_SLOCS_CREATE;
центр:
Цитата: CREATE TABLE SADOCDEFAULTS
(
DOCTYPE CHAR(2 BYTE) NOT NULL,
LOCATION NUMBER(10) NOT NULL,
NAMEPREFIX VARCHAR2(10 BYTE),
NUMBERSIZE NUMBER(5) NOT NULL,
PRICEKIND NUMBER(5),
NAMEOUTPREFIX VARCHAR2(10 BYTE)
)
TABLESPACE USERS
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 1M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
CREATE UNIQUE INDEX SACDOCDEFAULTS_PK ON SADOCDEFAULTS
(DOCTYPE, LOCATION)
TABLESPACE INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 1M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFNUMBERSIZE
CHECK (NumberSize between 1 and (50 - 10)));
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFAULTS_PK
PRIMARY KEY
(DOCTYPE, LOCATION)
USING INDEX
TABLESPACE INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 1M
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
));
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFLOCATION
FOREIGN KEY (LOCATION)
REFERENCES
ON DELETE CASCADE);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFPRICESTYPE
FOREIGN KEY (PRICEKIND)
REFERENCES);
ALTER TABLE SADOCDEFAULTS ADD (
CONSTRAINT SACDOCDEFDOCTYPE
FOREIGN KEY (DOCTYPE)
REFERENCES);
GRANT SELECT ON SADOCDEFAULTS TO SUPERMAG_USER;
GRANT DELETE, INSERT, SELECT, UPDATE ON SADOCDEFAULTS TO SUPERMAG_FN_EDITDOCDEFAULTS;
GRANT INSERT ON SADOCDEFAULTS TO SUPERMAG_FN_SLOCS_CREATE;