Is pl/sql having on error case?
HI,
I want to know is pl/sql having on error case to handling sql error?
following function will give me an error if invoice_seq havn't select nextval once.
any on error case instead of exception of following function?
function nextinvoicenumFunc RETURN NUMBER AS
nextinvoiceid number;
BEGIN
nextinvoiceid :=0;
select invoice_seq.currval +1 into nextinvoiceid from dual;
EXCEPTION
WHEN no_data_found THEN
SELECT min_value into nextinvoiceid FROM user_sequences WHERE sequence_name = 'invoice_seq';
RETURN nextinvoiceid;
END nextinvoicenumFunc;