You will need execute privilege for DBMS_LOB and you will need the privilege for CREATE ANY DIRECTORY. But this should help you along.
Code:CREATE DIRECTORY myfolder AS 'c:\myfolder\test_dat.txt';
declare
bad_file text_io.file_type;
v_file_handle BFILE;
begin
v_file_handle := bfilename( myfolder, 'test_dat.txt');
IF DBMS_LOB.FILEEXISTS(v_file_handle) = 1
THEN
bad_file := text_io.fopen('c:\myfoldr\test_bad.txt','R');
HOST('C:\WINDOWS\notepad.exe c:\myfolder\test_dat.txt');
ELSE
-- let the process know that the file doesn't exist!!!
END IF;
exception
when others then
null;
end;
