How to handle this below situation, I am getting error for function, my Postgres version is 9.4
BEGIN
select NEXT_NUMBER into STRICT id from
AUTONUMBERSETTING@REPOS.BIRCHSTREET.NET --pbeach_repos8.AUTONUMBERSETTING
where subscriber_id=subscriber and AUTO_NUMBER_ID=348 and company_id= buyer;
exception
when no_data_found then
insert into smerror_log(error_log_id,subscriber_id,company_id,error_message,system_message,
method_name,creation_date,creation_user,update_date,update_user)
values (nextval('smerror_log_sequence'),subscriber,buyer,'Auto Number not found',null,
'PunchoutProfile' ,LOCALTIMESTAMP,'Admin',LOCALTIMESTAMP,'Admin');
commit;
return;
end;