saurabh
saurabh

Reputation: 13

compilation errors ...even if code is right

create or replace trigger t2
    after insert or delete or update
    on emp_salary_details
    for each row
begin
    if inserting then
        insert into emp_table_audit
        values
        ( :new.emp_id
        , null
        , user
        , systimestamp
        , ‘INSERTION’ );

    elsif deleting then
        insert into emp_table_audit
        values
        ( null
        , :old.emp_id
        , user
        , systimestamp
        , ‘DELETION’ );

    elsif updating then
        insert into emp_table_audit
        values
        ( :new.emp_id
        , :old.emp_id
        , user
        , systimestamp
        , ‘UPDATION’ );
    end if;
end;

Upvotes: 0

Views: 43

Answers (1)

Littlefoot
Littlefoot

Reputation: 142710

Problem seems to be in a "fancy" single quote you use in all actions, for example

‘INSERTION’

If you look at what it really is (just first two characters):

select dump('‘I') from dual;

The result shows

Typ=96 Len=4: 226,128,152,73
  • 226, 128, 152 represent that "fancy" single quote
  • 73 is a capital letter "I"

Once you replace it with a "normal" single quote, everything should be just fine. Actually, seeing how old this question is, I hope you fixed it already, but a little bit of debugging technique can't hurt much.

Upvotes: 3

Related Questions