Oracle Cloud offers a broad portfolio of software as a service applications, platform as a service, and social capabilities, all on a subscription basis. Oracle Cloud delivers instant value and productivity for end users, administrators, and developers alike through functionally rich, integrated, secure, enterprise cloud services.
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

Subscribe to the OracleAppsHub to receive notifications when there are new posts:

 get RSS feed
 Oracle Fusion Applications (OFA) is a portfolio of next generation suite of software applications from Oracle Corporation. It is distributed across various product families; including financial management, human capital management, customer relationship management, supply chain management, procurement, governance, and project portfolio management
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

Oracle API Availability – Input/Output

Posted on August 11th, 2007 by Sanjit Anand |Print This Post Print This Post |Email This Post Email This Post

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today

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.

  • FND_FILE.PUT

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’);

  • FND_FILE.PUT_LINE

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

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)

  • FND_File.PUT_NAMES

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... */

  • FND_FILE.CLOSE
    This will closes open files.

This is normally used only during test and debug phase

Usage:
FND_File.Close;

Related Posts

Posted in API Integration | 2 Comments »Email This Post Email This Post | Print This Post Print This Post

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today
2 Responses
  1. Kurian James Says:

    Thanks a Lot!!!

  2. ajay Says:

    thank u for this useful text

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.