0

Oracle Sequence ID increase by double

if you are using trigger to generate sequence then might happened that the trigger is called twice. So to prevent from increasing the id value here is a little trick

CREATE OR REPLACE TRIGGER TRG_ABC BEFORE INSERT ON ABC
FOR EACH ROW
BEGIN
if :NEW.ID is null
then SELECT ABC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
end if;
END;

|

0 Comments

Copyright © 2009 So That I Can Remember All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.