Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: sending email via pl/ sql using query

RE: sending email via pl/ sql using query

From: Mercadante, Thomas F <Thomas.Mercadante_at_Labor.State.Ny.Us>
Date: Fri, 01 Feb 2002 06:36:52 -0800
Message-ID: <F001.004031E1.20020201051024@fatcity.com>

<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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US