I have a sequence like this
begin
if :new."ID" is null then
select to_number(sys_guid(),'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') into :new.id from dual;
end if;
is there a way to set the ID to be the next upcoming ID in the table?
For example:
if my current last row ID is 5
I want the new.id to be 6, so when the INSERT executes then it would have ID of 6
ROW_NUMBERto get contiguous numbers in the order of your ID column when you need them.