1 2 3 4 5 6 7 8 9 10 11 | create table tmp_tbl2( u_id varchar2(10), wdate date , n_sub_no char (3), n_stu_no varchar2(9), n_enr_grade number(3), o_sub_no char (3), o_stu_no varchar (9), o_enr_grade number(3), bigo char (1) ); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | create or replace trigger tri4 after insert or update or delete on enrol for each row begin if inserting then insert into tmp_tbl2(u_id, wdate, n_sub_no,n_stu_no, n_enr_grade, bigo) values ( user ,sysdate,:new.sub_no,:new.stu_no, :new.enr_grade, 'I' ); elsif updating then insert into tmp_tbl2(u_id, wdate, o_sub_no,o_stu_no, o_enr_grade,n_sub_no,n_stu_no, n_enr_grade bigo) values ( user ,sysdate,:old.sub_no, :old.stu_no, :old.enr.grade, :new.sub_no, :new.stu_no, :new.enr_grade, 'U' ); elsif deleting then insert into tmp_tbl2(u_id,wdate,o_sub_no,o_stu_no,o_enr_grade,bigo) values ( user ,sysdate,:olf.sub_no,:old.stu_no,:old.enr_grade, 'D' ) end if; end tri4; |
분명히 책 실습나온 코드대로 쳤는데 왜 에러가 발생하는지 모르겠어요