![]() |
Oracle
JDeveloper 10g for Forms &
PL/SQL
Developers
|
|
| Chapter | 6 | |
| Section | Using a Database Trigger to Allocate Sequences | Create
the BEFORE INSERT Trigger |
|
| Code | Script to create BEFORE INSERT trigger on Employees for Sequence allocation | |
| Return to listings... | ||
CREATE OR REPLACE TRIGGER employees_bi
BEFORE INSERT
ON employees
FOR EACH ROW
BEGIN
SELECT EMPLOYEES_SEQ.nextval
INTO :new.employee_id
FROM dual;
END;
/