Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Event Log won’t trim Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:11 | IP Logged Quote k2zs

Hello,

I ran into a problem while trying to trim my event log. Unfortunately I haven't done it sooner and the log goes back to December 2009, not sure if that's the problem.

When I try using the command:
ph_trimeventlog ( 0 ) or ph_trimeventlog ( 1 ), or ph_trimeventlog ( )

I get this in the event log:

An error occurred while trimming the eventlog table.
SQLSTATE = S1000
[Sybase][ODBC Driver][Adaptive Server Anywhere]General error: Unable to find in index 'eventlog' for table 'eventlog'

Is my database corrupt?

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: July 04 2010 at 11:24 | IP Logged Quote BeachBum

Long is bad. You might try ph_exporteventlog to get around the problem.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:34 | IP Logged Quote k2zs

ok, I'll try that Pete, Would the date/time format be like this:

2009-12-3 13:00:00

to represent December 3rd 2009 at 1:00 PM

That is my first event in the log...

Scott

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:39 | IP Logged Quote k2zs

I just tried this:
ph_exporteventlog ( 2009-12-26 13:00:00, 2010-07-04 11:40:00,1, c:\phevents.txt,0, 1 )
and it evaluated to !.

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:44 | IP Logged Quote k2zs

ok... I made the file name a string and it evaluated to a -4 so it still is having an issue trimming the event log.

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: July 04 2010 at 11:44 | IP Logged Quote BeachBum

I haven’t tried it yet but I would think you need to use relativedate ( date, n )

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:45 | IP Logged Quote k2zs

BeachBum wrote:
I haven’t tried it yet but I would think you need to use relativedate ( date, n )


Not sure what that means, can you show me?

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:49 | IP Logged Quote k2zs

I found that it did create the event log file as directed

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: July 04 2010 at 11:52 | IP Logged Quote BeachBum

Did it trim it?

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 11:55 | IP Logged Quote k2zs

no, it ieturned -4 when run and the event log is still full.

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: July 04 2010 at 12:00 | IP Logged Quote BeachBum

That doesn’t sound good. You might try phupg.exe from the PH directory and see what that does.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
k2zs
Senior Member
Senior Member
Avatar

Joined: October 22 2009
Location: United States
Online Status: Offline
Posts: 113
Posted: July 04 2010 at 12:09 | IP Logged Quote k2zs

Nice!

That did the trick.

Thanks Pete :)

__________________
Scott, K2ZS
Home Automation Ideas
Back to Top View k2zs's Profile Search for other posts by k2zs Visit k2zs's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: July 04 2010 at 12:14 | IP Logged Quote BeachBum

Sometimes we get lucky…

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 

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