Introdução 

 SQL Scripts 

 Packages 

 Packages Body 
 pkg_nkw_exc 
 pkg_nkw_rpl 
 pkg_nkw_std 
 pkg_nkw_app 
 pkg_nkw_spm 
 pkg_nkw_hfs 
 pkg_nkw_sdv 
 pkg_nkw_sys 
 pkg_nkw_obj 
 pkg_nkw_grv 
 pkg_nkw_usr 
 pkg_nkw_cmm 
 pkg_nkw_hlp 
 pkg_nkw_dvp 
 pkg_nkw_dnt_std 
 pkg_nkw_dnt_dvies 
 pkg_nkw_dnt_ccvies 
 pkg_nkw_dnt_logies 
 pkg_nkw_dnt_eppc 
 pkg_nkw_dnt_eapb 
 pkg_nkw_dnt_drmies 
 pkg_nkw_dnt 
 pkg_nkw_drm 
 pkg_nkw_oim 
 pkg_nkw_aud 
 pkg_nkw_dpl 
 pkg_nkw_srw 

 Forms 6i 

 Reports 6i 

Linux

 Downloads 
PKG_NKW_EXC.SPB
Source Package Body
Definições e log de exceções.
create or replace package body pkg_nkw_exc
timestamp '2006-07-07:10:10:10'
is
   ------------------------------------------------------------------
   -- 2006 DataPRO Developers - m@urelio
   ------------------------------------------------------------------
   -- Version: 2.0.2
   ------------------------------------------------------------------
   -- Collections, Records, Variables, Constants, Exceptions, Cursors
   ------------------------------------------------------------------
   gv_devbanner constant pkg_nkw_env.gv_char%TYPE := 'Where''s Nulaya ?' || chr(10);
   gv_path	constant pkg_nkw_hfs.gv_path%TYPE := pkg_nkw_hfs.gv_path;
   gv_file	constant pkg_nkw_hfs.gv_file%TYPE := 'devexc.log';
   ------------------------------------------------------------------
   ----------------------- Private Section --------------------------
   ------------------------------------------------------------------
   ------------------------------------------------------------------
   -- GET_SID
   ------------------------------------------------------------------
   function get_sid return varchar2
   is
      retval pkg_nkw_env.gv_char%TYPE;
   begin
      begin
	 declare cursor get_cur is
		 select chr(10) || to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') || ' (' ||
			sid || ',' || serial# || '-' || audsid || ') ' ||
			user# || '-' || username || chr(10)
			client_info
		   from v$session
		  where (audsid = userenv('SESSIONID'));
	 begin
	    if (not get_cur%ISOPEN) then
	       open get_cur;
	    end if;
	       fetch get_cur into retval;
	    if (get_cur%ISOPEN) then
	       close get_cur;
	    end if;
	    exception
	       when others then
		  if (get_cur%ISOPEN) then
		     close get_cur;
		  end if;
		  raise;
	 end;
      end;
      return retval;
      exception
	 when others then raise;
   end get_sid;
   ------------------------------------------------------------------
   ------------------------ Public Section --------------------------
   ------------------------------------------------------------------
   ------------------------------------------------------------------
   -- POP_EXCEPTION
   ------------------------------------------------------------------
   procedure pop_exception(fv_text  in varchar2,
			   fv_scope in integer := gv_devexc)
   is
      lv_text pkg_nkw_env.gv_plchar%TYPE;
   begin
      if (fv_scope = gv_devexc) then
	 lv_text := gv_devbanner || fv_text || chr(10) || sqlerrm;
	 pkg_nkw_hfs.fappend(fv_buffer => get_sid || lv_text,
			     fv_path   => gv_path,
			     fv_file   => gv_file);
	 raise_application_error(-20000, lv_text);
      else
	 lv_text := fv_text || '|' || chr(10) || sqlerrm;
	 raise_application_error(-20000, lv_text);
      end if;
      exception
	 when others then raise;
   end pop_exception;
end pkg_nkw_exc;
© 2017 DataPRO Developers