|
-
CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT ON departments
REFERENCING OLD AS old NEW AS new
FOR EACH ROW
BEGIN
IF :new.id IS NULL THEN
SELECT dept_seq.NEXTVAL
INTO :new.id
FROM dual;
END IF;
END;
/
Tim wouldn't it be a little faster that way:
CREATE OR REPLACE TRIGGER dept_bir
BEFORE INSERT
ON departments
FOR EACH ROW
WHEN (:new.id IS NULL)
BEGIN
SELECT dept_seq.NEXTVAL
INTO :new.id
FROM dual;
END;
/
Just a little bit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|