What is FND_FILE
An API that contains procedures to write text to log and output files which can be viewed once the Concurrent program get completed in output or log . These procedures can only be used within PL/SQL Procedures which, are concurrent programs.
Internally its uses the oracle supplied database package UTL_FILE
utl_file_dir parameter must be set to include the log and out directories for the applications that will run concurrent requests using FND_FILE
Database owner must have write privileges on those directories
Take a note that FND_FILE supports a maximum buffer line size of 32K for both log and output files.
Here are the list of Options available within API.
Useful for writing text to a file without a new line character. Multiple calls will concatenate the text .
Does not include new line character
FND_FILE.PUT (which IN NUMBER, buff IN VARCHAR2)
Which - Means LOG file or OUTPUT file.
Buff - Means text to write.
FND_File.Put(FND_File.Log, â€˜This text written to Log fileâ€™);
FND_File.Put(FND_File.Output, â€˜This text written to Log fileâ€™);
This is used to write a line of text to a file followed by a new line character
FND_FILE.PUT_LINE (which IN NUMBER, buff IN VARCHAR2)
FND_File.Put_Line(FND_File.Out, â€˜This text written to Out fileâ€™);
FND_FILE.NEW_LINE( which IN NUMBER, LINES IN NATURAL:= 1)
Writes line terminators (new line characters) to a file.
This is used to sets temporary log and out file names and directory, which normally used during test and debug phase.
FND_FILE.PUT_NAMES(p_log in varchar2,
p_out in varchar2,
p_dir in varchar2)
FND_File.Put_Names(â€˜Order123.logâ€™, â€˜Order123.outâ€™, â€˜/usr/temp/outfilesâ€™);
fnd_file.put_line(fnd_file.output,'Called stored procedure');
/* add logic, etc... */
fnd_file.put_line(fnd_file.output, 'transaction locked at point A');
/* More logic, etc... */
This will closes open files.
This is normally used only during test and debug phase