- OracleApps Epicenter - http://www.oracleappshub.com -

Oracle API Availability – Input/Output

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

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.

  • FND_FILE.LOG
  • FND_FILE.OUTPUT

Buff - Means text to write.

Usage
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)

Usage
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.
Eg. FND_FILE.NEW_LINE(FND_FILE.LOG,2)

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)
Usage
FND_File.Put_Names(‘Order123.log’, ‘Order123.out’, ‘/usr/temp/outfiles’);

Example
BEGIN
fnd_file.put_names('test.log', 'test.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 is normally used only during test and debug phase

Usage:
FND_File.Close;

2 Comments (Open | Close)

2 Comments To "Oracle API Availability – Input/Output"

#1 Comment By Kurian James On August 5, 2008 @ 12:36 am

Thanks a Lot!!!

#2 Comment By ajay On January 22, 2009 @ 3:33 am

thank u for this useful text