Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Bug Reports
 PowerHome Messageboard : PowerHome Bug Reports
Subject Topic: DB Woes: Cannot save/change/delete a time Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: June 18 2006 at 14:50 | IP Logged Quote onhiatus

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 View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 19 2006 at 16:05 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: June 28 2006 at 22:05 | IP Logged Quote onhiatus

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 View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum