Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How to build this specific trigger ?
I need a trigger who incremente automatically the id column of a table. Is this trigger is BEFORE INSERT or AFTER INSERT ? I try some test and I have the returned error : ORA-04098.
The SQL code of one of my test :
CREATE OR REPLACE TRIGGER "MSG".INS_TEST BEFORE INSERT OR UPDATE OF "ID" ON
"MSG"."TEST" DECLARE
new_id INTEGER;
BEGIN
new_id := select max(id,1) from msg.test;
id := new_id + 1;
END;
Thanks for any help.
![]() |
![]() |