File Handeling in Oracle is done with UTL_FILE and FND FILE
concurrent Request LOG and OUTPUT Files
FND_FILE can be used to write output and log messages from inside a concurrent request. We generally use a record message function as follows:
-
--
-
--**********************RECORD MESSAGE FNS*************************
-
--
-
Procedure Record_Message_Put_Line(WHICH in number, BUFF in varchar2)
-
--splits lines which are >255
-
IS
-
l_char_output number := 0;
-
l_loops number := 0;
-
record_message_error exception;
-
BEGIN
-
if (nvl(length(BUFF),0)<255) then
-
fnd_file.put_line(WHICH, BUFF);
-
return;
-
end if;
-
-
LOOP
-
EXIT WHEN (l_char_output>=length(BUFF)) or (l_loops>1000);
-
-
fnd_file.put(WHICH, substr(BUFF,l_char_output+1,254));
-
l_char_output := l_char_output + length(substr(BUFF,l_char_output,254));
-
-
l_loops := l_loops + 1;
-
END LOOP;
-
fnd_file.put_line(WHICH, '');
-
-
if l_loops>1000 then
-
raise record_message_error;
-
end if;
-
-
EXCEPTION
-
WHEN record_message_error THEN
-
fnd_file.put_line(fnd_file.LOG,'RM Error');
-
fnd_file.put_line(fnd_file.LOG,BUFF);
-
WHEN OTHERS THEN
-
fnd_file.put_line(fnd_file.LOG,'Error recording message in Record_Message_Put_Line');
-
END;
-
--
-
Procedure Record_Message(
-
p_type IN Varchar2,
-
p_message IN Varchar2,
-
p_special_file IN UTL_FILE.FILE_TYPE default null
-
)
-
IS
-
BEGIN
-
IF p_type = 'LOG' THEN
-
Record_Message_Put_Line(fnd_file.LOG,p_message);
-
ELSIF p_type = 'OUTPUT' THEN
-
if (p_special_file.id is null) then
-
Record_Message_Put_Line(fnd_file.OUTPUT,p_message);
-
else
-
utl_file.put_line(p_special_file,p_message);
-
end if;
-
ELSIF p_type = 'BOTH' THEN
-
Record_Message_Put_Line(fnd_file.LOG,p_message);
-
Record_Message_Put_Line(fnd_file.OUTPUT,p_message);
-
END IF;
-
-
EXCEPTION
-
WHEN OTHERS THEN
-
fnd_file.put_line(fnd_file.LOG,'Error recording message');
-
-
END Record_Message;
-
--
-
--**********************ENF RECORD MESSAGE FNS*************************
-
--
Directories
Directories are listed in DBA_DIRECTORIES Table.
CR Log files go in $APPLCSF/$APPLLOG
Output files go in $APPLCSF/$APPLOUT
Inside a concurrent request you can find this path with the following query:
-
select
-
substr(outfile_name,0,length(outfile_name)-12)
-
into l_cr_pack_path
-
from fnd_concurrent_requests
-
where request_id=fnd_global.conc_request_id;
Test code for Record Message FN
-
Record_Message('BOTH','');
-
Record_Message('BOTH','SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA12345678901234567890BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBF');
-
Record_Message('BOTH','SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA01234567890123456F');
-
Record_Message('BOTH','SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA012345678901234567F');
-
return;
RJM Article Type
Quick Reference