BEGIN
  -- ... --
  -- statements --
  -- ... --
      
  RAISE_APPLICATION_ERROR(-20000, 'Custom error'); /*-20000 .. -20999*/
  --RAISE NO_DATA_FOUND;
  COMMIT;
EXCEPTION
  WHEN NO_DATA_FOUND THEN 
    ROLLBACK;        
    DBMS_OUTPUT.put_line('Nessun dato trovato');    
  WHEN OTHERS THEN 
     ROLLBACK;
     DBMS_OUTPUT.put_line(sqlerrm);    
END;