Select and display table in oracle

Is it possible to display and display the database table in a way classic report

in the body of an email when sending mail to oracle APEX 4.2

?

Version : oracle APEX 4.2

SAMPLE : SAMPLE FORMAT FOR E-MAIL

Regards, DOC

+3


source to share


1 answer


Yes, you can by sending an HTML email, but you must create the HTML yourself yourself. For example:

declare
   l_body_text long;
   l_body_html long;
begin
   l_body_html := '<table style="border-collapse: collapse; border: 1px solid black"><tbody>'
                  || '<tr>'
                  || '<th style="background-color: #eef; border: 1px solid black">ENAME</th>'
                  || '<th style="background-color: #eef; border: 1px solid black">DNAME</th></tr>';

   for r in (select ename, dname from emp)
   loop
      l_body_html := l_body_html || '<tr><td style="border: 1px solid black">' 
                     || r.ename || '</td><td style="border: 1px solid black">'
                     || r.dname|| '</td></tr>';
   end loop;
   l_body_html := l_body_html || '</tbody></table>';

   l_body_text := 'Plain text version';

   apex_mail.send
      ( p_to        => 'you@there.com'
      , p_from      => 'me@here.com'
      , p_body      => l_body_text
      , p_body_html => l_body_html
      , p_subj      => 'Your report'
      );
end;

      



Note:

  • You need to provide an alternative to plain text if the recipient cannot receive HTML emails.
  • You need to apply any style on the line - you cannot link to a CSS file.
+1


source







All Articles