1 Reply Latest reply: Sep 16, 2013 8:08 AM by Ramesh P, Oracle APEX Developer RSS

    unable to send runtime details in a mail

    942793

      Hi Gurus,

       

      I've developed an application for leave management system. When a person applies for leave, a mail is sent to Manager for approval(done by using the api). However, the from_date and to_date are not being sent. Null values are printed for those values. The following is the api that  I  have used in the process.Please help me resolve this. Thanks in advance.

       

      DECLARE

          l_body      CLOB;

        

      BEGIN

          l_body := 'Leave applied from '||to_date(nvl(:P10_REQUEST_FROM_DATE,sysdate),'DD/MON/YYYY')||' to '||to_date(nvl(:P10_REQUEST_TO_DATE,sysdate),'DD/MON/YYYY')||utl_tcp.crlf||utl_tcp.crlf;

          l_body := l_body ||'  Sincerely,'||utl_tcp.crlf;

          l_body := l_body ||'  LMS Team'||utl_tcp.crlf;

          apex_mail.send(

              p_to       => 'sathish_uttarapally@DELL.com',   -- change to your email address

              p_from     => 'sathish_uttarapally@dell.com', -- change to a real senders email address

              p_body     => l_body,

              p_subj     => 'Leave Application');

       

       

      APEX_MAIL.push_queue;

      END;

       

      Output: Leave applied from to

        • 1. Re: unable to send runtime details in a mail
          Ramesh P, Oracle APEX Developer

          Hi,

           

          l_body := 'Leave applied from '||to_date(nvl(:P10_REQUEST_FROM_DATE,sysdate),'DD/MON/YYYY')||' to '||to_date(nvl(:P10_REQUEST_TO_DATE,sysdate),'DD/MON/YYYY')||utl_tcp.crlf||utl_tcp.crlf;

           

          use to_char instead of to_date.

           

          l_body := 'Leave applied from '||to_char(nvl(:P10_REQUEST_FROM_DATE,sysdate),'DD/MON/YYYY')||' to '||to_char(nvl(:P10_REQUEST_TO_DATE,sysdate),'DD/MON/YYYY')||utl_tcp.crlf||utl_tcp.crlf;