Oracle: add an autoID

This entry was posted by on Wednesday, 7 March, 2012 at


create sequence PAGE_PROPERTIES_ID;


create or replace trigger PAGE_PROPERTIES_ID
before insert on PAGE_PROPERTIES
for each row
begin
if :new.id is null then
select PAGE_PROPERTIES_ID.nextval into :new.id from dual;
end if;
end;
/


Leave a Reply