Author |
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 18 2006 at 14:50 | IP Logged
|
|
|
I've got a macro that I wanted to run every three hours starting just after mid-night. Easy. Except that somehow when I entered it I buggered up the reference time and it never ran. When I looked at the timed events it showed a date of '0000-12-04 00:00:00' - clearly wrong. Now when I try to change it or even just delete it, I get a db error:
SQLSTATE=07006
[Sybase][ODBC Driver][Adaptive Server Anywhere]Restricted data type attribute violation: Cannot convert SQLDATETIME to a date.
No changes made to database.
DELETE FROM "timedevents" WHERE "starttime"= ? AND "frequency" = ? AND "type" = ? AND "action" = ? AND "timing" = ? AND "reftime" = ? AND "offsettype" = ? AND "offsetamount" = ?
Thoughts on how to get this out of timedevents list?
Just to be clear - this is not an emergency, the other timed events are still running (including the correct version of the event that caused this problem), I'd just like to get it off my screen - my failures offend me...
Thanks, Tony
Edited by onhiatus - June 18 2006 at 14:56
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 19 2006 at 16:05 | IP Logged
|
|
|
Tony,
WOW, I'll check this out and try to determine what happened and why it won't let you delete.
In any event, you should be able to manually delete it from the multi-editor/SQL using a delete statement. Just don't include the reference time (or probably the start time) in the where clause. It should look something like:
delete from timedevents where action = 'The full text of your action here';
Be VERY careful when doing this. Go into the Explorer first and look and see if the timed event you are trying to delete has the very same action in any other timed event. If the same action appears in more than just the bad timed event, they will be deleted as well.
As you can see from the error, the Explorer tries to delete based upon every column. We can't do that because we don't want to use the corrupted date fields so were using a reduced "where" clause. I chose the "action" column as it would be the most likely unique column.
Let me know if this will work for you (unique action in the bad event) and if not, email me a screenshot of your timed events and I'll be able to come up with a SQL statement that will do the job for you.
PS. you may want to backup your database prior to doing this using the ph_backupdb function.
Dave.
|
Back to Top |
|
|
onhiatus Senior Member
Joined: May 12 2004 Location: United States
Online Status: Offline Posts: 279
|
Posted: June 28 2006 at 22:05 | IP Logged
|
|
|
Oops, missed your response. I'm going to try to get you a backup of my db for my other issue (ph eats my cpu) - so you can see this problem as well...
|
Back to Top |
|
|