Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: sending email via pl/ sql using query
<SPAN
class=503270713-01022002>Suhen,
<SPAN
class=503270713-01022002>
Using
PL/SQL cursors, you can build any kind of dynamic string you want, place the
result in a PL/SQL variable, and email it to whomever you
want.
<SPAN
class=503270713-01022002>
<SPAN
class=503270713-01022002>Give an example of your sql select statement, and
I'll be glad to help.
Tom Mercadante <FONT face=Arial
size=2>Oracle Certified Professional
<FONT face=Tahoma
size=2>-----Original Message-----From: Suhen Pather
[mailto:Suhen.Pather_at_strandbags.com.au]Sent: Thursday, January 31,
2002 10:25 PMTo: Multiple recipients of list
ORACLE-LSubject: sending email via pl/ sql using
query
<SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">List,
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt">I am trying to send email from Oracle when a table is
updated.
<SPAN
style="FONT-SIZE: 10pt">The message must be a dynamic one, so hard coded
message will not be allowed.
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt">I have created a trigger when the table is updated -
that works
<SPAN
style="FONT-SIZE: 10pt">I am using UTL_SMTP to send emails. <SPAN
class=GramE>- that
works
<SPAN
style="FONT-SIZE: 10pt">However this procedure (<SPAN
class=SpellE>send_mail) only has hard-coded messages. - I need it to be
a dynamic message, from a query which I already
have.
<SPAN
style="FONT-SIZE: 10pt">The query will return more than 1
row.
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt">- So the trigger executes when a column is
updated.
<SPAN
style="FONT-SIZE: 10pt">- A query would be executed giving the required
information to be mailed.
<SPAN
style="FONT-SIZE: 10pt">- email program must kick
off, emailing the results of the above query.
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt">Any ideas how to do
this.
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt">Thanks & Regards
<SPAN
style="FONT-SIZE: 10pt">Suhen
<SPAN
style="FONT-SIZE: 10pt">
<SPAN
style="FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
Received on Fri Feb 01 2002 - 08:36:52 CST