sql - UTL_MAIL message attribute calling OWA_UTIL.cellsprint procedure Oracle -


hi have following html snippet, want send via email in procedure. how put in message attribute of utl_mail. should put in variable , if how?

if there better way, love explore too.i have 2 options below.i not able make message attribute work.

option 1    declare     begin     utl_mail.send (       sender       => 'xxx@yyy',       recipients   => 'abc@xyz',       subject      => 'hi',       message      =>        owa_util.cellsprint (p_thequery =>'select   a1,b1,c1,d1                          test1                         a1 > 1                      order a1',       p_max_rows=>'10',p_format_numbers => null),        mime_type    => 'text/html; charset=us-ascii');      end;      ----------------------------------------------------------------     option2     declare         begin         ....         ......         utl_mail.send (           sender       => 'xxx@yyy',           recipients   => 'abc@xyz',           subject      => 'hi',           message      => ***           mime_type    => 'text/html; charset=us-ascii');         ***          htp.p ('<html>');          htp.p ('<head>');          htp.p ('<title>duplicate records</title>');          htp.p ('</head>');          htp.p ('<body>');          htp.p ('<h1>duplicate records</h1>');          htp.p ('<table border="1 ">');          htp.p ('<tr><th>hierarchy</th><th>org long name</th></tr>');           idx in (select   a1,b1,c1,d1                          test1                         a1 > 1                      order a1 loop           htp.p ('<tr>');           htp.p ('<td>' || idx.a1 || '</td>');           htp.p ('<td>' || idx.b1 || '</td>');           htp.p ('<td>' || idx.c1 || '</td>');           htp.p ('<td>' || idx.d1 || '</td>');           htp.p ('</tr>');          end loop;           htp.p ('</table>');          htp.p ('</body>');          htp.p ('</html>');           end; 

utl_mail.send's message varchar2 parameter, takes string parameter.

htp.p , owa_util.cellsprint procedures, not functions, cannot used pass value mail. they're designed use in web-based application, , not suitable other purposes mail.

you use functions in htf if want, in case you've written html may pass directly message:

utl_mail.send (       sender       => 'xxx@yyy',       recipients   => 'abc@xyz',       subject      => 'hi',       message      => '<html>...'       mime_type    => 'text/html; charset=us-ascii'); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -