PL/SQL (MOSC)

MOSC Banner

Checking File exists or not

edited Dec 27, 2013 1:02AM in PL/SQL (MOSC) 1 commentAnswered
Hi All,
I created One script for Checking File exists or not.If file present also it giving NO.Can you please help me.

create or replace function FileExists(
  p_DirName in varchar2 := '/dat/p/inbound/back_qty',     -- schema object name
  p_FileName in varchar2 := 'XXPLL_BACKLOG.csv'
) return number
is
  l_fexists boolean;
  l_flen   number;
  l_bsize  number;
 
--p_FileName        UTL_FILE.file_type;
  l_res    number(1);
begin
  l_res := 0;
  sys.utl_file.fgetattr((p_DirName), p_FileName, l_fexists l_flen, l_bsize);
  if l_fexists
  then
    l_res := 1;
  end if; 
  return l_res;
end;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center