Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling database validation --- Problems

Status
Not open for further replies.

nurya

Technical User
Mar 2, 2004
12
ES
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top