Generate a .log file plsql / oracle

4.5k views Asked by At

What i want do, is to generate a .log file that describes all my error, start time, end time, and so one. I found a way to have something like that but not in corect way.

I want to generate that file automaticaly, without being required to define it manually. From what i have understood, is that UTL_FILE.FOPEN, when is not found that file, create one.

My app. is working. The question is, HOW TO GENERATE A FILE IN PLSQL (.log file) without create it manually.

create or replace procedure read_files(input varchar2) as  
  begin
  declare

F2 UTL_FILE.FILE_TYPE;
F2 := UTL_FILE.FOPEN('FOLDER',input||'.log','w');
UTL_FILE.put_line(F2,'Start processing file at : ' || systimestamp);
UTL_FILE.put_line(F2,'End processing file at :'||systimestamp);  
 -- Close file  
UTL_FILE.FCLOSE(F2); 
END; --end begin
1

There are 1 answers

0
Silviu On BEST ANSWER

I found the probleme ! Where I stored my files, I had no right to create files / folders. THANKS all !