Oracle APEX 21.2.0.
I have an IG on DEPT table. And a process that runs before ARP process wth the followng code
select nvl(max(deptno), 0) + 1 into :deptno from dept;
when I try to add more than one row I got "Unique constraint violated" error. It does not make sense to me because when I click SAVE I am still in the same database session which means that insert statement fired and added one to the max deptno value so a new value should be retrieved with each row?
I know I can use a sequence but I need to know why this approach does not work?