[1] What are different type of Concurrent Program execution methods available in apps?
Oracle Report, SQL * Plus,
SQL * Loader, PLSQL Stored Procedure,
Java Stored Procedure, Java Concurrent Program,
Perl Concurrent Program, Multi Language Function,
Request Set Stag Function, Host, Immediate, Spawned etc.
[2] Why we use FND_FILE package?
The FND_FILE package contains procedures to write text to log and output
files. These procedures are supported in all types of concurrent programs.We
can use the procedures FND_FILE.PUT_NAMES and FND_FILE.CLOSE for testing
and debugging.
Note: These two procedures should not be called from a concurrent program.
FND_FILE supports a maximum buffer line size of 32K for both log and output files.
FND_FILE.PUT
Summary
procedure FND_FILE.PUT (which IN NUMBER, buff IN VARCHAR2);
Description
Use this procedure to write text to a file (without a new line character).
Multiple calls to FND_FILE.PUT will produce concatenated text. Typically
used with FND_FILE.NEW_LINE.
Arguments (input)
which | Log file or output file. Use either FND_FILE.LOG or FND_FILE.OUTPUT. |
buff | Text to write. |
FND_FILE.PUT_LINE
Summary
procedure FND_FILE.PUT_LINE (which IN NUMBER, buff IN VARCHAR2);
Description
Use this procedure to write a line of text to a file (followed by a new line character).
You will use this utility most often.
Arguments (input)
which | Log file or output file. Use either FND_FILE.LOG or FND_FILE.OUTPUT. |
buff | Text to write. |
Example
Using Message Dictionary to retrieve a message already set up on the server and
putting it in the log file (allows the log file to contain a translated message):
FND_FILE.PUT_LINE( FND_FILE.LOG, fnd_message.get );Putting a line of text in
the log file directly (message cannot be translated because it is hard coded in
English; not recommended):
fnd_file.put_line(FND_FILE.LOG,'Warning: Employee '||l_log_employee_name||' ('||
l_log_employee_num ||
') does not have a manager.');
FND_FILE.NEW_LINE
procedure FND_FILE.NEW_LINE(which IN NUMBER, LINES IN NATURAL := 1);
Description
Use this procedure to write line terminators (new line characters) to a file.
Arguments (input)
which | Log file or output file. Use either FND_FILE.LOG or FND_FILE.OUTPUT. |
lines | Number of line terminators to write. |
Example
To write two new line characters:
fnd_file.new_line(FND_FILE.LOG,2);FND_FILE.PUT_NAMES
procedure FND_FILE.PUT_NAMES
(p_log IN VARCHAR2,p_out IN VARCHAR2,
(p_dir IN VARCHAR2);Description
Sets the temporary log and out filenames and the temp directory to the user-specified
values. DIR must be a directory to which the database can write. FND_FILE.PUT_NAMES
should be called before calling any other FND_FILE function, and only once per session.
Attention: FND_FILE.PUT_NAMES is meant for testing and debugging from SQL*Plus;
it does nothing if called from a concurrent program.
Arguments (input)
p_log | Temporary log filename. |
p_out | Temporary output filename. |
p_dir | Temporary directory name. |
Example
fnd_file.put_names('test.log', 'test.out',
'/local/db/8.0.4/db-temp-dir/');
fnd_file.put_line(fnd_file.output,'Called stored procedure');
/* Some logic here... */
fnd_file.put_line(fnd_file.output, 'Reached point A');
/* More logic, etc... */
fnd_file.close;
END;
FND_FILE.CLOSE
procedure FND_FILE.CLOSE;
Description
Use this procedure to close open files.
Attention: Use FND_FILE.CLOSE only in command lines sessions. FND_FILE.CLOSE should
not be called from a concurrent program.
Example
fnd_file.put_names('test.log', 'test.out',
'/local/db/8.0.4/db-temp-dir/');
fnd_file.put_line(fnd_file.output,'Called stored procedure');
/* Some logic here... */
fnd_file.put_line(fnd_file.output, 'Reached point A');
/* More logic, etc... */
fnd_file.close;
END;
Note: FND_FILE.LOG or FND_FILE.OUTPUT use to write in file of respective directories.
No comments:
Post a Comment