Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

My trigger does not work ?


I log in sybase iq using default user dba. Then I create a trigger:

create or replace trigger test

before update of level on grade

referencing new as new_gr

for each row


    set new_gr.level = new_gr.level + 1;


And here is the structure of the grade table:

create table grade(

    level int,

    grade_mark numeric(8, 3)


Then I issue the following statements:

insert into grade(level, grade_mark) values(1, 5.0);

select * from grade;

update grade set level=2 where grade_mark=5.0;

select * from grade;

I find that the trigger does not fire after update statement.

I expect the level should be 3, but it is still 2 for grade_mark 5.0

Please help me.



Helpful Answer

Not what you were looking for? View more on this topic or Ask a question