Hi everybody,
I work with Adaptive Server Anywhere. I'm automating some tasks using schedules and events and I have encountered some problems when trying to include validation in an event. The following code works alone (tested from Interactive SQL):
call sa_validate (check_type = 'express');
if @@error != 0 then
call xp_startsmtp( smtp_sender= 'Sender_Name',
smtp_server= 'Server_Name');
call xp_sendmail( recipient = 'Recipient_Name',
subject = 'Validatioin test',
"message"= 'Error in validation');
call xp_stopsmtp ();
return
end if;
call xp_startsmtp( smtp_sender = 'Sender_Name',
smtp_server = 'Server_Name');
call xp_sendmail( recipient = 'Recipient_Name',
subject = 'Validation test',
"message"= 'Validation done');
call xp_stopsmtp ();
But when I try to enclose it into an event handler, it does not!!!
create event Validation_test
schedule
start time '1:00 AM' every 24 hours
handler
begin
---- Same code as before ----
end
I tried to debug the event but can't find any clue.
Can anybody give me an explanation?
Thanks in advanced,
Nurya
I work with Adaptive Server Anywhere. I'm automating some tasks using schedules and events and I have encountered some problems when trying to include validation in an event. The following code works alone (tested from Interactive SQL):
call sa_validate (check_type = 'express');
if @@error != 0 then
call xp_startsmtp( smtp_sender= 'Sender_Name',
smtp_server= 'Server_Name');
call xp_sendmail( recipient = 'Recipient_Name',
subject = 'Validatioin test',
"message"= 'Error in validation');
call xp_stopsmtp ();
return
end if;
call xp_startsmtp( smtp_sender = 'Sender_Name',
smtp_server = 'Server_Name');
call xp_sendmail( recipient = 'Recipient_Name',
subject = 'Validation test',
"message"= 'Validation done');
call xp_stopsmtp ();
But when I try to enclose it into an event handler, it does not!!!
create event Validation_test
schedule
start time '1:00 AM' every 24 hours
handler
begin
---- Same code as before ----
end
I tried to debug the event but can't find any clue.
Can anybody give me an explanation?
Thanks in advanced,
Nurya