I got table1 that contains sequential number in range between 1 - 100 and I want to get out missing number using pl without creating new table
I tried to do it by this way but it absolutely not professional way and I tried to use select min_val.nextval keyword but I fail so any simple and professional way to do it
declare
min_val number(4);
max_val number(4);
current_val number(4);
cursor ids_cur is
select ids from test1;
begin
for ids_rec in ids_cur
loop
if min_val is not null then
min_val:=min_val+1;
DBMS_OUTPUT.PUT_LINE(min_val);
else
DBMS_OUTPUT.PUT_LINE(min_val);
end if;
end loop;
end;