Hi everybody,

I work with Adaptive Server Anywhere 8. 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 ();
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
start time '1:00 AM' every 24 hours
---- Same code as before ----

I tried to debug the event but find no clue.
Can anybody give me an explanation?

Thanks in advanced,