SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DBMAIL in a trigger....

 
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools View previous topic
View next topic
DBMAIL in a trigger....
Author Message
Sal emma



Joined: 12 Sep 2003
Posts: 4

Post DBMAIL in a trigger.... Reply with quote

Hello,
We would like to use dbmail inside a trigger.
Does anyone have any code examples that we could use?

thanks,
Sal Emma

Thu Sep 11, 2003 5:11 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6484

Post Re: DBMAIL in a trigger.... Reply with quote

For sample code please see examples in the DB Mail online help. It does not really matter where you call DB Mail - from a trigger from a stored procedure or from a function. It is all the same. As long as you know how to write a trigger it should be fairly simple. If you are not familiar with triggers please see trigger examples available in Oracle documentation and in large quantities on the Internet

Try this http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=oracle+trigger+example+code

: Hello,
: We would like to use dbmail inside a trigger.
: Does anyone have any code examples that we could use?

: thanks,
: Sal Emma

Thu Sep 11, 2003 10:50 pm View user's profile Send private message
Sal emma



Joined: 12 Sep 2003
Posts: 4

Post Re: DBMAIL in a trigger.... Reply with quote

: For sample code please see examples in the DB Mail online help. It does not
: really matter where you call DB Mail - from a trigger from a stored
: procedure or from a function. It is all the same. As long as you know how
: to write a trigger it should be fairly simple. If you are not familiar
: with triggers please see trigger examples available in Oracle
: documentation and in large quantities on the Internet

: Try this
: http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=oracle+trigger+example+code
'
If I call the send_mail in a select statement in a trigger,
oracle tells me that it is expecting an "into" clause.

Do I have to set up a stored procedure to execute from the trigger?
What is the syntax of the send_email function to simply send an email with the
:new.values to a :new.emailaddress in a before insert trigger?
Your help is greatly appreciated.
Thanks very much.
Sal Emma

Fri Sep 12, 2003 10:39 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6484

Post Re: DBMAIL in a trigger.... Reply with quote

In PL/SQL you cannot just do a SELECT. It must be either INSERT INTO [table]..SELECT or SELECT..INTO [variables]

If you just want to send email using known parameters (no need to do any SELECT) just call this function direcly as below

RETURN_VAR := function( [function arguments here] );

Therefore for SEND_MAIL you would have

RETURN_VAR := SEND_MAIL( [function arguments here] );

: '
: If I call the send_mail in a select statement in a trigger,
: oracle tells me that it is expecting an "into" clause.

: Do I have to set up a stored procedure to execute from the trigger?
: What is the syntax of the send_email function to simply send an email with
: the
: Your help is greatly appreciated.
: Thanks very much.
: Sal Emma

Fri Sep 12, 2003 12:53 pm View user's profile Send private message
ToanTranDuc



Joined: 28 Sep 2003
Posts: 2

Post Re: DBMAIL in a trigger.... Reply with quote

: Hello,
: We would like to use dbmail inside a trigger.
: Does anyone have any code examples that we could use?

: thanks,
: Toan

Sun Sep 28, 2003 9:47 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.