This discussion is archived
2 Replies Latest reply: Mar 11, 2013 11:35 AM by steve.g RSS

Oracle Periodic Alert - How to write output to log

steve.g Newbie
Currently Being Moderated
I have set up a periodic alert which runs a sql procedure and sends email if not successful. I can show the concurrent job id and the output in the email, but when I write to concurrent log, it does not end up there. I tried both log and output.

Does anyone know how to get the info to show in the log?

Thanks.
Steve

Example of sql:

declare
v_sender varchar2(50) := 'oracle@here.com';
v_recipients varchar2(200) := 'me@here.com';
v_subject varchar2(100) := 'EDI Dock2Stock failure';
v_msg varchar2(2000);
v_status varchar2(20);
v_type varchar2(20) := '&TYP';
begin
v_status := hypr.ebiz.RUN_EBIZ_PROCESS(v_type, 'ASND2S', '1.0', null, v_msg);
if v_status != 'success' then
v_msg := 'Test for '|| v_type || chr(10)
|| 'Status = ' || v_status || chr(10)
|| v_msg ||':' ||apps.fnd_global.CONC_REQUEST_ID;
apps.ht_mail.mail( v_sender, v_recipients, v_subject, v_msg );
if apps.fnd_global.CONC_REQUEST_ID > 0 then
apps.FND_FILE.put_line (apps.FND_FILE.output, 'Result XML');
apps.FND_FILE.put_line (apps.FND_FILE.LOG, v_msg);
end if;
end if;
end;
/
  • 1. Re: Oracle Periodic Alert - How to write output to log
    Hussein Sawwan-Oracle Employee ACE
    Currently Being Moderated
    steve.g wrote:
    I have set up a periodic alert which runs a sql procedure and sends email if not successful. I can show the concurrent job id and the output in the email, but when I write to concurrent log, it does not end up there. I tried both log and output.

    Does anyone know how to get the info to show in the log?
    Please see if these docs help.

    The Request Stay In Status Running Instead of Finish [ID 580463.1]
    Creating a PL/SQL Concurrent Program in Oracle Applications [ID 73492.1]
    How to Handle New Date Formats in SQL*Plus and PL/SQL Procedures? [ID 376034.1]
    APPS:FND - Using DBMS_OUTPUT.PUT_LINE in Concurrent Programs [ID 186094.1]

    Thanks,
    Hussein
  • 2. Re: Oracle Periodic Alert - How to write output to log
    steve.g Newbie
    Currently Being Moderated
    I have looked at these threads and many more and can not understand why the apps.FND_FILE.put_line (apps.FND_FILE.output, 'Result XML');
    apps.FND_FILE.put_line (apps.FND_FILE.LOG, v_msg);
    lines are not writing to the logs.
    Both the session id and the concurrent id are available.
    I tried fnd_global.INITIALIZE and fnd_global.APPS_INITIALIZE and no output or logging.
    Is it even possible to write to the periodic alert log?
    If so, can someone send me an example?

    Thanks.
    Steve

    ps I know I can do it by spawning another concurrent job, but I would like to just put it in the alert log if possible.

    Edited by: steve.g on Mar 11, 2013 11:34 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points