Hi
Using 11.2.0.3 and have the following code to try and check for file existence.
Directory and file definitely exists and user/schema has had grant all on directory specfifed granted to them.
Anything else need to do ?
Wjen run it says file does not exist - tried uppare and lower case.
declare
v_file_exists BOOLEAN;
v_file_length NUMBER;
v_block_size NUMBER;
begin
-- Create a process to load data to archive
--A process will need to run on a regular basis to query the datain.txt_finance_gl table. If an error is raised that shows the file cannot be found then it exits and waits to run the next time.
--If data is returned, then the data can be queried and loaded into the archive table with the relevant sequence number and datestamp.
--The txt_load_control will be used to control and audit the transfer.
--The next sequence number in the txt_finance_gl_seq will be obtained along with the current datetime and used to create a new entry in the control table (edc_type will be ‘GL’) and given a status of running.
--On completion of the load, the flat file will be renamed (pre-fixing the sequence number onto the old name) and moved into the finance processed folder.
--The control table can then be updated to show the run as complete.
-- First check if file exists on disk in expected area.
utl_file.fgetattr('big_tab_data', 'testfile', v_file_exists,v_file_length,v_block_size);
IF v_file_exists THEN
dbms_output.put_line('File Exists');
ELSE
dbms_output.put_line('File Does Not Exist');
END IF;
end;