I've written a procedure in oracle that will send an email. I would like to include variables in the body of the message that should refer to the variables calculated in another procedure.
As an example let's say I have procedure:
select a1+a2
into a
from table c;
And the next step would be to send an email, including a, like:
create or replace PROCEDURE MAIL AS
BEGIN
DECLARE
l_html VARCHAR2(32767);
BEGIN
l_html := '<html>
<body>
<p>a</p> <!-- here I'd like my result from another procedure to appear-->
</body>
</html>';
utl_mail.send(sender => 'something@bla.com',
recipients => 'bla@bla.com',
message => l_html,
mime_type => 'text/html'
);
The code is oversimplified to show the general idea, what I am looking for is how to make a connection between two procedures like these. Since the first procedure is quite huge, including sending an mail within the same procedure is not an option. Thanks in advance for any tips/ideas!