Note that there are some explanatory texts on larger screens.

plurals
  1. POUTL_MAIL message attribute calling OWA_UTIL.cellsprint procedure Oracle
    primarykey
    data
    text
    <p>Hi I have the following html snippet, I want to send via email in my procedure. How do I put that in my message attribute of UTL_MAIL. Should I put it in some variable and if so how?</p> <p>If there is any better way, I would love to explore that too.I have two options below.I am not able to make the MESSAGE attribute work.</p> <pre><code>OPTION 1 DECLARE BEGIN UTL_MAIL.SEND ( sender =&gt; 'xxx@yyy', recipients =&gt; 'abc@xyz', subject =&gt; 'Hi', MESSAGE =&gt; OWA_UTIL.cellsprint (p_theQuery =&gt;'SELECT a1,b1,c1,d1 FROM test1 WHERE a1 &gt; 1 ORDER BY a1', p_max_rows=&gt;'10',p_format_numbers =&gt; NULL), mime_type =&gt; 'text/html; charset=us-ascii'); END; ---------------------------------------------------------------- OPTION2 Declare Begin .... ...... UTL_MAIL.SEND ( sender =&gt; 'xxx@yyy', recipients =&gt; 'abc@xyz', subject =&gt; 'Hi', MESSAGE =&gt; *** mime_type =&gt; 'text/html; charset=us-ascii'); *** HTP.P ('&lt;HTML&gt;'); HTP.P ('&lt;HEAD&gt;'); HTP.P ('&lt;TITLE&gt;Duplicate Records&lt;/TITLE&gt;'); HTP.P ('&lt;/HEAD&gt;'); HTP.P ('&lt;BODY&gt;'); HTP.P ('&lt;H1&gt;Duplicate Records&lt;/H1&gt;'); HTP.P ('&lt;TABLE BORDER="1 "&gt;'); HTP.P ('&lt;TR&gt;&lt;TH&gt;HIERARCHY&lt;/TH&gt;&lt;TH&gt;Org Long NAME&lt;/TH&gt;&lt;/TR&gt;'); FOR idx IN (SELECT a1,b1,c1,d1 FROM test1 WHERE a1 &gt; 1 ORDER BY a1 LOOP HTP.P ('&lt;TR&gt;'); HTP.P ('&lt;TD&gt;' || idx.a1 || '&lt;/TD&gt;'); HTP.P ('&lt;TD&gt;' || idx.b1 || '&lt;/TD&gt;'); HTP.P ('&lt;TD&gt;' || idx.c1 || '&lt;/TD&gt;'); HTP.P ('&lt;TD&gt;' || idx.d1 || '&lt;/TD&gt;'); HTP.P ('&lt;/TR&gt;'); END LOOP; HTP.P ('&lt;/TABLE&gt;'); HTP.P ('&lt;/BODY&gt;'); HTP.P ('&lt;/HTML&gt;'); END; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload