Курсовая работа: База данных велосипедного магазина

CREATE SEQUENCE "SEQFIRMI" MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;

CREATE SEQUENCE "SEQTIPI_TOVAROV" MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;

CREATE SEQUENCE "SEQTOVARI" MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE;


4. Примеры создания триггеров

CREATE OR REPLACE TRIGGER INSERT_IN_PERSONAL

BEFORE INSERT ON PERSONAL

FOR EACH ROW

BEGIN

SELECT SEQPERSONAL.NEXTVAL INTO :new.KOD FROM DUAL;

END;

/

CREATE OR REPLACE TRIGGER INSERT_IN_FIRMI

BEFORE INSERT ON FIRMI

FOR EACH ROW

BEGIN

SELECT SEQFIRMI.NEXTVAL INTO :new.KOD FROM DUAL;

END;

/

CREATE OR REPLACE TRIGGER INSERT_IN_TIPI_TOVAROV

BEFORE INSERT ON TIPI_TOVAROV

FOR EACH ROW

BEGIN

SELECT SEQTIPI_TOVAROV.NEXTVAL INTO :new.KOD FROM DUAL;

END;

/

CREATE OR REPLACE TRIGGER INSERT_IN_TOVARI

BEFORE INSERT ON TOVARI

FOR EACH ROW

BEGIN

К-во Просмотров: 595
Бесплатно скачать Курсовая работа: База данных велосипедного магазина