Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Trigger Help
I know this can't be too tough, but I just can't seem to get it done.
I have a sequence called empl_seq.
When I insert into the the table (employee) I want it to put
the sequence number into the employee table, and then insert the
sequence number again in two other tables, with extra data.
So here is the before insert trigger which does NOT work.
create or replace trigger employee_before_ins_row
before insert on EMPLOYEE
for each row
begin
:new.seq_num := :empl_seq.nextval;
end;
Here is the trigger which does work. This one takes the seq_num and makes the relationship in two other tables.
create or replace trigger employee_after_ins_row
after insert on EMPLOYEE
for each row
begin
insert into employee_checklist values (:new.seq_num,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Any help here would be extremely appreciated....
Thank you, thank you, thank you....
-Steven Job Received on Fri Feb 20 1998 - 00:00:00 CST