When I am running the below code I am getting the error.
declare
x int ;
begin
x:=APP_COMP_DETAIL_STG_ID_SEQ.nextval;
dbms_output.put_line('values is '||x);
end;
/
Error report - ORA-01403: no data found ORA-06512: at line 4 01403. 00000 - "no data found" *Cause: No data was found from the objects. *Action: There was no data from the objects which may be due to end of fetch.
Actually, the sequence is not generating any value. It is valid and it is not reached to max value. I am really not sure where is the issue. When I am running select APP_COMP_DETAIL_STG_ID_SEQ.nextval from dual;
I am not getting any output.
This is a production issue.
There is no issue on sequence. issue is in dual table. Actually someone created dual table in our local environment. so instead of pointing to synonym of sys.dual it was pointing to our local table. after deleting that table our issue has been resolved. We could also use sys.dual but it is not a good practice.