Basic trigger question [message #204736] |
Tue, 21 November 2006 22:46 |
toenie2
Messages: 7 Registered: November 2006
|
Junior Member |
|
|
Hi,
I searched and looked and tried, but I can't figure out this one. It's basic, but I hope you can help.
I am trying to start a trigger which sends a mail to a new user in my webapplication.
Again, basic stuff:
CREATE OR REPLACE TRIGGER USER_T2
AFTER
insert on "USERTABLE"
for each row
DECLARE
MAIL VARCHAR2(32);
BEGIN
MAIL :=:new.emailaddress;
send_mail(:new:MAIL, 'Subject', 'Enter text here');
end;
/
What am I doing wrong here?
Thanks in advance.
|
|
|
|
Re: Basic trigger question [message #204771 is a reply to message #204737] |
Wed, 22 November 2006 01:16 |
toenie2
Messages: 7 Registered: November 2006
|
Junior Member |
|
|
Thanks for your reaction, I understand that I gave little info, it was my first post, though.
I am using Oracle 10g on Windows XP. send_mail is a procedure which sends mail. It has 3 values, like this:
send_mail (emailaddress, subject, text)
My mailserver works, I tested send_mail with a fixed emailaddress, like this:
send_mail (toenie@hotmail.com, mysubject, mytext)
So that is not the point. What I try to achieve is that when someone in my webapplication opens an account (his login being his emailaddress), to confirm this by sending him (or her) an email. This is where the trigger comes in. The trigger needs to get the emailaddress column from the new row.
Is this a better description of my problem?
|
|
|
|