hi all,
i need to call a proceedure for sending email by setting up a "INSERT AFTER" trigger for a table.i need to pass the mail id as a parameter to the procedure for sending email. that procedure works just fine.the probelm is when i try to dclare variables inside the trigger and run it i get a warning message:Warning : Trigger created with compilation errors.
here is my code for the trigger:
[code=oracle]
CREATE OR REPLACE TRIGGER scheck
AFTER insert
ON memorydetail
FOR EACH ROW
DECLARE
tomsg mailid.mail_id% type;
tomsg:='jitendr a.kumar4@wipro. com';
BEGIN
IF (to_number(new. WS)>50000) THEN
smail(tomsg,'He llo from Oracle','This is the body of the message');
END IF
END;
.
run;
[/code]
even if i try to change the datatype of the variable "tomsg" i get the warning message and the email is not sent.
but if i explicitly give the email id in the call to "smail" like
[code=oracle]
smail('jitendra .kumar4@wipro.c om', 'Hello from Oracle', 'This is the body of the message');
[/code]
it works.
where am i going wong???
can anybody help?
i need to call a proceedure for sending email by setting up a "INSERT AFTER" trigger for a table.i need to pass the mail id as a parameter to the procedure for sending email. that procedure works just fine.the probelm is when i try to dclare variables inside the trigger and run it i get a warning message:Warning : Trigger created with compilation errors.
here is my code for the trigger:
[code=oracle]
CREATE OR REPLACE TRIGGER scheck
AFTER insert
ON memorydetail
FOR EACH ROW
DECLARE
tomsg mailid.mail_id% type;
tomsg:='jitendr a.kumar4@wipro. com';
BEGIN
IF (to_number(new. WS)>50000) THEN
smail(tomsg,'He llo from Oracle','This is the body of the message');
END IF
END;
.
run;
[/code]
even if i try to change the datatype of the variable "tomsg" i get the warning message and the email is not sent.
but if i explicitly give the email id in the call to "smail" like
[code=oracle]
smail('jitendra .kumar4@wipro.c om', 'Hello from Oracle', 'This is the body of the message');
[/code]
it works.
where am i going wong???
can anybody help?
Comment