Hi All,
I am a very new beginner to db2 and trying to convert an oracle trigger to a db2 one.
My issue is with the exception used in oracle, "EXCEPTION WHEN OTHERS WHEN". How do I convert or in other terms use the db2 way of handling any exceptions?
This is my code I have in DB2 so far
Any help would be greatly appreciated.
I am a very new beginner to db2 and trying to convert an oracle trigger to a db2 one.
My issue is with the exception used in oracle, "EXCEPTION WHEN OTHERS WHEN". How do I convert or in other terms use the db2 way of handling any exceptions?
This is my code I have in DB2 so far
Code:
CREATE TRIGGER LOGS_TRG NO CASCADE BEFORE INSERT ON xxx_log REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL BEGIN ATOMIC IF(N.ID is null) then SET N.ID = nextval for xxx_log_id_seq; --SIGNAL SQLSTATE '-20000' SET MESSAGE_TEXT='INTERNAL TRIGGER ERROR'; end if; end!
Comment